mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
Refine code style and tests
This commit is contained in:
@@ -21,10 +21,7 @@ final class PresenterCompilerPass implements CompilerPassInterface
|
||||
foreach ($container->findTaggedServiceIds('flasher.presenter') as $id => $tags) {
|
||||
foreach ($tags as $attributes) {
|
||||
if (!isset($attributes['alias'])) {
|
||||
throw new \InvalidArgumentException(\sprintf(
|
||||
'Service "%s" tagged with "flasher.presenter" must have an "alias" attribute.',
|
||||
$id
|
||||
));
|
||||
throw new \InvalidArgumentException(\sprintf('Service "%s" tagged with "flasher.presenter" must have an "alias" attribute.', $id));
|
||||
}
|
||||
|
||||
$definition->addMethodCall('addPresenter', [
|
||||
|
||||
@@ -15,7 +15,7 @@ final class OctaneListenerTest extends TestCase
|
||||
|
||||
// Verify the listener is invokable (has __invoke method)
|
||||
// This is crucial for Laravel's event dispatcher to call it correctly
|
||||
$this->assertTrue(is_callable($listener));
|
||||
$this->assertIsCallable($listener);
|
||||
}
|
||||
|
||||
public function testListenerHasInvokeMethod(): void
|
||||
|
||||
@@ -113,7 +113,7 @@ final class TranslatorTest extends TestCase
|
||||
|
||||
$this->laravelTranslatorMock->expects()
|
||||
->get('flasher::messages.key', \Mockery::on(function ($params) {
|
||||
return isset($params['name']) && $params['name'] === 'John';
|
||||
return isset($params['name']) && 'John' === $params['name'];
|
||||
}), null)
|
||||
->andReturns('Hello John');
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ final class InstallCommandTest extends MockeryTestCase
|
||||
{
|
||||
// Create a kernel that returns a non-existent project directory
|
||||
// This will cause getPublicDir() to return null
|
||||
$kernel = new class() extends Kernel {
|
||||
$kernel = new class extends Kernel {
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('test', true);
|
||||
|
||||
Reference in New Issue
Block a user