Skip to content
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

Phpstan discovered some problems #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/EventDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ public function dispatch(object $event)

protected function call(string $class, object $event): void
{
do_action($this->prefix . $class, $event);
\do_action($this->prefix . $class, $event);
}
}
10 changes: 5 additions & 5 deletions src/ParameterDeriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static function getParameterType($callable): string
*
* @param callable $callable
*
* @return True if the callable represents a function, false otherwise.
* @return bool True if the callable represents a function, false otherwise.
*/
protected static function isFunctionCallable(callable $callable): bool
{
Expand All @@ -86,7 +86,7 @@ protected static function isFunctionCallable(callable $callable): bool
*
* @param callable $callable
*
* @return True if the callable represents a closure object, false otherwise.
* @return bool True if the callable represents a closure object, false otherwise.
*/
protected static function isClosureCallable(callable $callable): bool
{
Expand All @@ -98,7 +98,7 @@ protected static function isClosureCallable(callable $callable): bool
*
* @param callable $callable
*
* @return True if the callable represents a method object, false otherwise.
* @return bool True if the callable represents a method object, false otherwise.
*/
protected static function isObjectCallable(callable $callable): bool
{
Expand All @@ -120,7 +120,7 @@ protected static function isObjectCallable(callable $callable): bool
*
* @param callable $callable
*
* @return True if the callable represents a static method, false otherwise.
* @return bool True if the callable represents a static method, false otherwise.
*/
protected static function isClassCallable($callable): bool
{
Expand All @@ -132,7 +132,7 @@ protected static function isClassCallable($callable): bool
*
* @param callable $callable
*
* @return True if the callable represents an invokable object, false otherwise.
* @return bool True if the callable represents an invokable object, false otherwise.
*/
private static function isInvokable(callable $callable): bool
{
Expand Down
2 changes: 1 addition & 1 deletion src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
function listen(callable $callable, int $priority = 10, string $prefix = EventDispatcher::DEFAULT_PREFIX): void
{
$class = ParameterDeriver::getParameterType($callable);
add_action($prefix . $class, static function (object $subject) use ($callable) {
\add_action($prefix . $class, static function (object $subject) use ($callable) {
if ($subject instanceof StoppableEventInterface && $subject->isPropagationStopped()) {
return;
}
Expand Down