Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loosen checkForExclude callback parameter type declaration
Browse files Browse the repository at this point in the history
JoshuaLicense committed Aug 21, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent a50af07 commit d6ed9bb
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Annotation/AbstractBuilder.php
Original file line number Diff line number Diff line change
@@ -310,7 +310,7 @@ protected function checkForExclude(AnnotationCollection $annotations): bool

// @codingStandardsIgnoreStart
$results = $this->getEventManager()->triggerEventUntil(
static fn(bool $r): bool => true === $r,
static fn(?bool $r): bool => true === $r,
$event
);
// @codingStandardsIgnoreEnd
14 changes: 14 additions & 0 deletions test/Annotation/AbstractBuilderTestCase.php
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@
use LaminasTest\Form\TestAsset\Annotation\Form;
use LaminasTest\Form\TestAsset\Annotation\InputFilter;
use LaminasTest\Form\TestAsset\Annotation\InputFilterInput;
use PHPUnit\Framework\Attributes\DoesNotPerformAssertions;
use PHPUnit\Framework\Attributes\WithoutErrorHandler;
use PHPUnit\Framework\TestCase;
use Throwable;
@@ -573,4 +574,17 @@ public function testLegacyStyleValidatorAnnotations(): void
ErrorHandler::restoreErrorHandler();
}
}

#[DoesNotPerformAssertions]
public function testAllowsEventListenerReturnVoid(): void
{
$entity = new TestAsset\Annotation\Entity();
$builder = $this->createBuilder();

$builder->getEventManager()->attach('*', function () {
// return void;
});

$builder->createForm($entity);
}
}

0 comments on commit d6ed9bb

Please sign in to comment.