Skip to content

Commit b568f6e

Browse files
committed
fixed phpDoc
1 parent f76b5dc commit b568f6e

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

phpstan.neon

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ parameters:
6969
identifier: greater.alwaysTrue
7070
path: tests/types/utils-types.php
7171

72-
# Image.php: Callback signature intentionally simplified (doesn't use int parameter)
73-
-
74-
identifier: argument.type
75-
path: src/Utils/Image.php
76-
count: 1
77-
7872
# Image.php: Defensive validation even though phpDoc specifies positive-int
7973
-
8074
identifiers:

src/Utils/Arrays.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ public static function mapWithKeys(array $array, callable $transformer): array
496496

497497
/**
498498
* Invokes all callbacks and returns array of results.
499-
* @param iterable<callable(): mixed> $callbacks
499+
* @param iterable<callable> $callbacks
500500
* @param mixed ...$args
501501
* @return array<mixed>
502502
*/

src/Utils/Callback.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class Callback
2323
/**
2424
* Invokes internal PHP function with own error handler.
2525
* @param list<mixed> $args
26-
* @param callable(string, int): ?bool $onError
26+
* @param callable(string, int): (bool|void|null) $onError
2727
*/
2828
public static function invokeSafe(string $function, array $args, callable $onError): mixed
2929
{
@@ -52,7 +52,7 @@ public static function invokeSafe(string $function, array $args, callable $onErr
5252
/**
5353
* Checks that $callable is valid PHP callback. Otherwise throws exception. If the $syntax is set to true, only verifies
5454
* that $callable has a valid structure to be used as a callback, but does not verify if the class or method actually exists.
55-
* @return callable(): mixed
55+
* @return callable
5656
* @throws Nette\InvalidArgumentException
5757
*/
5858
public static function check(mixed $callable, bool $syntax = false): mixed
@@ -86,7 +86,7 @@ public static function toString(mixed $callable): string
8686

8787
/**
8888
* Returns reflection for method or function used in PHP callback.
89-
* @param callable(): mixed $callable type check is escalated to ReflectionException
89+
* @param callable $callable type check is escalated to ReflectionException
9090
* @throws \ReflectionException if callback is not valid
9191
*/
9292
public static function toReflection($callable): \ReflectionMethod|\ReflectionFunction
@@ -109,7 +109,6 @@ public static function toReflection($callable): \ReflectionMethod|\ReflectionFun
109109

110110
/**
111111
* Checks whether PHP callback is function or static method.
112-
* @param callable(): mixed $callable
113112
*/
114113
public static function isStatic(callable $callable): bool
115114
{
@@ -119,7 +118,6 @@ public static function isStatic(callable $callable): bool
119118

120119
/**
121120
* Unwraps closure created by Closure::fromCallable().
122-
* @param \Closure(): mixed $closure
123121
* @return \Closure|array{object|class-string, string}|callable-string
124122
*/
125123
public static function unwrap(\Closure $closure): callable|array

0 commit comments

Comments
 (0)