Skip to content

Cleanup - #21

Merged
Crell merged 9 commits into
masterfrom
cleanup
Jul 1, 2026
Merged

Crell merged 9 commits into
masterfrom
cleanup

Conversation

@Crell

@Crell Crell commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Bump some versions, improve docs, and add some types. Preparing for the next tagged release.

Comment thread src/ParameterDeriverTrait.php
@garrettw

Copy link
Copy Markdown
Contributor

Also, while you're fixing up the README, maybe you could fix these too:
image

@mathroc mathroc left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just left a bunch of suggestions, feel free to pick what's interesting if any and discard the rest

Comment thread src/TaggedProviderTrait.php
*
* @param string $tag
* The tag for which we want relevant Listeners.
* @return iterable

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @return iterable<callable(object)>

abstract protected function getListenersForAllTags() : iterable;

/**
* @return iterable<callable>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @return iterable<callable>
* @template T
* @param T $event
* @return iterable<callable(T)>

* tag-specific Listeners will always be invoked first.
*
* @return iterable
* @return iterable<callable>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @return iterable<callable>
* @return iterable<callable(object)>

* @param callable $callable
* @return bool
* True if the callable represents a static method, false otherwise.
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @psalm-assert-if-true list{class-string, ...} $callable
*/

// See the docblock of isClassCallable() for why this needs to come first.
if ($this->isClassCallable($callable)) {
$reflect = new \ReflectionClass($callable[0]);
$params = $reflect->getMethod($callable[1])->getParameters();

This comment was marked as resolved.

@@ -35,8 +35,7 @@

$rType = $params[0]->getType();

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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 Closure::fromCallable()? Dunno.)

Comment thread src/DelegatingProvider.php
Comment on lines 103 to +107
* @param object $event
* The Event to match against.
* @param iterable $listenerSet
* An iterable in the format returned by getListenersForTag()/getListenersForAllTags().
* @return iterable
* @return iterable<callable>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @return iterable<callable>
* @template T
* @param object $event
* The Event to match against.
* @param iterable<iterable<T>> $listenerSet
* An iterable in the format returned by getListenersForTag()/getListenersForAllTags().
* @return iterable<T>

*
* @param callable $callable
* @return bool
* True if the callable represents an invokable object, false otherwise.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* True if the callable represents an invokable object, false otherwise.
* @psalm-assert-if-true object $callable

@Crell

Crell commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

I'm going to pass on most of the additional generics and Psalm stuff. Using tool-specific tags is a larger question for FIG, and I'd want to spend enough time on it to make sure all the generics are correct. And right now this project doesn't even have an SA configured. 😄

I'll merge this tomorrow and tag a release unless there's other feedback specifically on the changes in the patch already.

Comment thread src/AggregateProvider.php
Comment thread composer.json
@Crell
Crell merged commit d413d55 into master Jul 1, 2026
10 checks passed
@Crell
Crell deleted the cleanup branch July 1, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants