Refine code style and tests

This commit is contained in:
Younes ENNAJI
2026-03-01 20:16:44 +00:00
parent 4d9cda22cf
commit 87da42fdea
4 changed files with 4 additions and 7 deletions
@@ -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
+1 -1
View File
@@ -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');
+1 -1
View File
@@ -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);