-
-
Notifications
You must be signed in to change notification settings - Fork 7
Cleanup #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup #21
Changes from all commits
928667d
71e0c5a
82eb98c
ab1bded
69fe265
b4eef6d
e399268
5916559
adb5d73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| build | ||
| composer.lock | ||
| vendor | ||
| .phpunit.result.cache |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,24 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <phpunit bootstrap="vendor/autoload.php" | ||
| <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" | ||
| bootstrap="vendor/autoload.php" | ||
| backupGlobals="false" | ||
| backupStaticAttributes="false" | ||
| colors="true" | ||
| verbose="true" | ||
| convertErrorsToExceptions="true" | ||
| convertNoticesToExceptions="true" | ||
| convertWarningsToExceptions="true" | ||
| processIsolation="false" | ||
| stopOnFailure="false"> | ||
| <testsuites> | ||
| <testsuite name="Event Dispatcher Test Suite"> | ||
| <directory>tests</directory> | ||
| </testsuite> | ||
| </testsuites> | ||
| <filter> | ||
| <whitelist> | ||
| <directory suffix=".php">src/</directory> | ||
| </whitelist> | ||
| </filter> | ||
| <logging> | ||
| <log type="tap" target="build/report.tap"/> | ||
| <log type="junit" target="build/report.junit.xml"/> | ||
| <log type="coverage-html" target="build/coverage"/> | ||
| <log type="coverage-text" target="build/coverage.txt"/> | ||
| <log type="coverage-clover" target="build/logs/clover.xml"/> | ||
| </logging> | ||
| stopOnFailure="false" | ||
| cacheDirectory="build/phpunit.cache" | ||
| backupStaticProperties="false" | ||
| > | ||
| <testsuites> | ||
| <testsuite name="Event Dispatcher Test Suite"> | ||
| <directory>tests</directory> | ||
| </testsuite> | ||
| </testsuites> | ||
| <logging> | ||
| <junit outputFile="build/report.junit.xml"/> | ||
| </logging> | ||
| <source> | ||
| <include> | ||
| <directory suffix=".php">src/</directory> | ||
| </include> | ||
| </source> | ||
| </phpunit> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ trait ParameterDeriverTrait | |
| * | ||
| * @param callable $callable | ||
| * The callable for which we want the parameter type. | ||
| * @return string | ||
| * @return class-string | ||
| * The class the parameter is type hinted on. | ||
| */ | ||
| protected function getParameterType($callable): string | ||
|
|
@@ -35,8 +35,7 @@ protected function getParameterType($callable): string | |
|
|
||
| $rType = $params[0]->getType(); | ||
This comment was marked as resolved.
Sorry, something went wrong.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suspect there's a decent amount of refactoring and error handling that could be done here, but that's out of scope for this PR. I just wanted to hit some low-hanging fruit before tagging the new 8.1-specific release. If you want to try improving that, though, follow-on PRs are welcome. (For that matter, it's possible we could simplify most of it with |
||
| if ( | ||
| $rType === null // no type declared | ||
|
Crell marked this conversation as resolved.
|
||
| || !($rType instanceof \ReflectionNamedType) // type is union or intersection | ||
| !($rType instanceof \ReflectionNamedType) // type is missing, union, or intersection | ||
| || $rType->isBuiltIn() // type is built-in, aka scalar/primitive | ||
| ) { | ||
| throw new \InvalidArgumentException('Listeners must declare a single class/interface type they can accept.'); | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -75,14 +75,17 @@ abstract protected function getListenersForTag(string $tag): iterable; | |||||||||
| * Note that this method is called after getListenersForTag(), so | ||||||||||
| * tag-specific Listeners will always be invoked first. | ||||||||||
| * | ||||||||||
| * @return iterable | ||||||||||
| * @return iterable<callable> | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| * An ordered iterable of candidate Listeners. The key of each entry | ||||||||||
| * is the Event type the Listener is for. (It will also apply if the | ||||||||||
| * $type is a parent of the Event's type.) The value is an iterable | ||||||||||
| * of Listeners that apply to that type. | ||||||||||
| */ | ||||||||||
| abstract protected function getListenersForAllTags() : iterable; | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * @return iterable<callable> | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| */ | ||||||||||
| public function getListenersForEvent(object $event) : iterable | ||||||||||
| { | ||||||||||
| $eventType = $this->eventType(); | ||||||||||
|
|
@@ -101,7 +104,7 @@ public function getListenersForEvent(object $event) : iterable | |||||||||
| * The Event to match against. | ||||||||||
| * @param iterable $listenerSet | ||||||||||
| * An iterable in the format returned by getListenersForTag()/getListenersForAllTags(). | ||||||||||
| * @return iterable | ||||||||||
| * @return iterable<callable> | ||||||||||
| * An iterable of listeners to be called. | ||||||||||
| */ | ||||||||||
| protected function filterListenersForEvent(object $event, iterable $listenerSet): iterable | ||||||||||
|
|
||||||||||
Uh oh!
There was an error while loading. Please reload this page.