Skip to content

Commit 01c4f57

Browse files
committed
improved phpDoc
1 parent 9d7fbd8 commit 01c4f57

5 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/Utils/ArrayList.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*/
2222
class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate
2323
{
24+
/** @var list<T> */
2425
private array $list = [];
2526

2627

src/Utils/Callback.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ final class Callback
2222

2323
/**
2424
* Invokes internal PHP function with own error handler.
25+
* @param array<mixed> $args
2526
*/
2627
public static function invokeSafe(string $function, array $args, callable $onError): mixed
2728
{

src/Utils/Image.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ class Image
146146
/**
147147
* Returns RGB color (0..255) and transparency (0..127).
148148
* @deprecated use ImageColor::rgb()
149+
* @return array{red: int, green: int, blue: int, alpha: int}
149150
*/
150151
public static function rgb(int $red, int $green, int $blue, int $transparency = 0): array
151152
{

src/Utils/Strings.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,10 @@ public static function replace(
659659
}
660660

661661

662+
/**
663+
* @param array<array<array{string, int}>> $groups
664+
* @return array<array<array{string, int}>>
665+
*/
662666
private static function bytesToChars(string $s, array $groups): array
663667
{
664668
$lastBytes = $lastChars = 0;

src/Utils/Validators.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ public static function isList(mixed $value): bool
290290
/**
291291
* Checks if the value is in the given range [min, max], where the upper or lower limit can be omitted (null).
292292
* Numbers, strings and DateTime objects can be compared.
293+
* @param array{0?: int|float|string|\DateTimeInterface, 1?: int|float|string|\DateTimeInterface} $range
293294
*/
294295
public static function isInRange(mixed $value, array $range): bool
295296
{

0 commit comments

Comments
 (0)