Skip to content

Commit 91ac71b

Browse files
authored
Merge pull request #276 from JoshuaLicense/fix-developer-tools-type-error-1
Loosen `checkForExclude` callback parameter type declaration
2 parents a50af07 + b7774ac commit 91ac71b

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/Annotation/AbstractBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ protected function checkForExclude(AnnotationCollection $annotations): bool
310310

311311
// @codingStandardsIgnoreStart
312312
$results = $this->getEventManager()->triggerEventUntil(
313-
static fn(bool $r): bool => true === $r,
313+
static fn(?bool $r): bool => true === $r,
314314
$event
315315
);
316316
// @codingStandardsIgnoreEnd

test/Annotation/AbstractBuilderTestCase.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
use LaminasTest\Form\TestAsset\Annotation\Form;
3131
use LaminasTest\Form\TestAsset\Annotation\InputFilter;
3232
use LaminasTest\Form\TestAsset\Annotation\InputFilterInput;
33+
use PHPUnit\Framework\Attributes\DoesNotPerformAssertions;
3334
use PHPUnit\Framework\Attributes\WithoutErrorHandler;
3435
use PHPUnit\Framework\TestCase;
3536
use Throwable;
@@ -573,4 +574,17 @@ public function testLegacyStyleValidatorAnnotations(): void
573574
ErrorHandler::restoreErrorHandler();
574575
}
575576
}
577+
578+
#[DoesNotPerformAssertions]
579+
public function testAllowsEventListenerReturnVoid(): void
580+
{
581+
$entity = new TestAsset\Annotation\Entity();
582+
$builder = $this->createBuilder();
583+
584+
$builder->getEventManager()->attach('*', function () {
585+
// return void;
586+
});
587+
588+
$builder->createForm($entity);
589+
}
576590
}

0 commit comments

Comments
 (0)