diff --git a/src/ArrayObject.php b/src/ArrayObject.php index 5b13bff4..24b823b9 100644 --- a/src/ArrayObject.php +++ b/src/ArrayObject.php @@ -85,10 +85,9 @@ public function __construct($input = [], $flags = self::STD_PROP_LIST, $iterator /** * Returns whether the requested key exists * - * @param mixed $key * @return bool */ - public function __isset($key) + public function __isset(mixed $key) { if ($this->flag === self::ARRAY_AS_PROPS) { return $this->offsetExists($key); @@ -104,11 +103,9 @@ public function __isset($key) /** * Sets the value at the specified key to value * - * @param mixed $key - * @param mixed $value * @return void */ - public function __set($key, $value) + public function __set(mixed $key, mixed $value) { if ($this->flag === self::ARRAY_AS_PROPS) { $this->offsetSet($key, $value); @@ -125,10 +122,9 @@ public function __set($key, $value) /** * Unsets the value at the specified key * - * @param mixed $key * @return void */ - public function __unset($key) + public function __unset(mixed $key) { if ($this->flag === self::ARRAY_AS_PROPS) { $this->offsetUnset($key); @@ -145,10 +141,9 @@ public function __unset($key) /** * Returns the value at the specified key by reference * - * @param mixed $key * @return mixed */ - public function &__get($key) + public function &__get(mixed $key) { if ($this->flag === self::ARRAY_AS_PROPS) { $ret = &$this->offsetGet($key); @@ -166,10 +161,9 @@ public function &__get($key) /** * Appends the value * - * @param mixed $value * @return void */ - public function append($value) + public function append(mixed $value) { $this->storage[] = $value; } @@ -299,11 +293,10 @@ public function natsort() /** * Returns whether the requested key exists * - * @param mixed $key * @return bool */ #[ReturnTypeWillChange] - public function offsetExists($key) + public function offsetExists(mixed $key) { return isset($this->storage[$key]); } @@ -311,11 +304,10 @@ public function offsetExists($key) /** * Returns the value at the specified key * - * @param mixed $key * @return mixed */ #[ReturnTypeWillChange] - public function &offsetGet($key) + public function &offsetGet(mixed $key) { $ret = null; if (! $this->offsetExists($key)) { @@ -329,12 +321,10 @@ public function &offsetGet($key) /** * Sets the value at the specified key to value * - * @param mixed $key - * @param mixed $value * @return void */ #[ReturnTypeWillChange] - public function offsetSet($key, $value) + public function offsetSet(mixed $key, mixed $value) { $this->storage[$key] = $value; } @@ -342,11 +332,10 @@ public function offsetSet($key, $value) /** * Unsets the value at the specified key * - * @param mixed $key * @return void */ #[ReturnTypeWillChange] - public function offsetUnset($key) + public function offsetUnset(mixed $key) { if ($this->offsetExists($key)) { unset($this->storage[$key]); diff --git a/src/ArraySerializableInterface.php b/src/ArraySerializableInterface.php index f2544535..adb5231f 100644 --- a/src/ArraySerializableInterface.php +++ b/src/ArraySerializableInterface.php @@ -9,7 +9,6 @@ interface ArraySerializableInterface /** * Exchange internal values from provided array * - * @param array $array * @return void */ public function exchangeArray(array $array); diff --git a/src/ArrayUtils.php b/src/ArrayUtils.php index 285e644d..fb2efcc5 100644 --- a/src/ArrayUtils.php +++ b/src/ArrayUtils.php @@ -46,11 +46,10 @@ abstract class ArrayUtils /** * Test whether an array contains one or more string keys * - * @param mixed $value * @param bool $allowEmpty Should an empty array() return true * @return bool */ - public static function hasStringKeys($value, $allowEmpty = false) + public static function hasStringKeys(mixed $value, $allowEmpty = false) { if (! is_array($value)) { return false; @@ -66,11 +65,10 @@ public static function hasStringKeys($value, $allowEmpty = false) /** * Test whether an array contains one or more integer keys * - * @param mixed $value * @param bool $allowEmpty Should an empty array() return true * @return bool */ - public static function hasIntegerKeys($value, $allowEmpty = false) + public static function hasIntegerKeys(mixed $value, $allowEmpty = false) { if (! is_array($value)) { return false; @@ -97,7 +95,7 @@ public static function hasIntegerKeys($value, $allowEmpty = false) * @param bool $allowEmpty Should an empty array() return true * @return bool */ - public static function hasNumericKeys($value, $allowEmpty = false) + public static function hasNumericKeys(mixed $value, $allowEmpty = false) { if (! is_array($value)) { return false; @@ -130,7 +128,7 @@ public static function hasNumericKeys($value, $allowEmpty = false) * @param bool $allowEmpty Is an empty list a valid list? * @return bool */ - public static function isList($value, $allowEmpty = false) + public static function isList(mixed $value, $allowEmpty = false) { if (! is_array($value)) { return false; @@ -172,7 +170,7 @@ public static function isList($value, $allowEmpty = false) * @param bool $allowEmpty Is an empty array() a valid hash table? * @return bool */ - public static function isHashTable($value, $allowEmpty = false) + public static function isHashTable(mixed $value, $allowEmpty = false) { if (! is_array($value)) { return false; @@ -198,7 +196,7 @@ public static function isHashTable($value, $allowEmpty = false) * @param int|bool $strict * @return bool */ - public static function inArray($needle, array $haystack, $strict = false) + public static function inArray(mixed $needle, array $haystack, $strict = false) { if (! $strict) { if (is_int($needle) || is_float($needle)) { @@ -318,7 +316,6 @@ public static function merge(array $a, array $b, $preserveNumericKeys = false) /** * @deprecated Since 3.2.0; use the native array_filter methods * - * @param array $data * @param callable $callback * @param null|int $flag * @return array diff --git a/src/ArrayUtils/MergeReplaceKey.php b/src/ArrayUtils/MergeReplaceKey.php index aa501099..063e0681 100644 --- a/src/ArrayUtils/MergeReplaceKey.php +++ b/src/ArrayUtils/MergeReplaceKey.php @@ -6,10 +6,7 @@ final class MergeReplaceKey implements MergeReplaceKeyInterface { - /** - * @param mixed $data - */ - public function __construct(protected $data) + public function __construct(protected mixed $data) { } diff --git a/src/FastPriorityQueue.php b/src/FastPriorityQueue.php index e620c74b..b356c3e6 100644 --- a/src/FastPriorityQueue.php +++ b/src/FastPriorityQueue.php @@ -112,11 +112,10 @@ public function __unserialize(array $data): void /** * Insert an element in the queue with a specified priority * - * @param mixed $value * @param int $priority * @return void */ - public function insert($value, $priority) + public function insert(mixed $value, $priority) { if (! is_int($priority)) { throw new Exception\InvalidArgumentException('The priority must be an integer'); @@ -158,7 +157,7 @@ public function extract() * @param mixed $datum * @return bool False if the item was not found, true otherwise. */ - public function remove($datum) + public function remove(mixed $datum) { $currentIndex = $this->index; $currentSubIndex = $this->subIndex; @@ -375,10 +374,9 @@ public function isEmpty() /** * Does the queue contain the given datum? * - * @param mixed $datum * @return bool */ - public function contains($datum) + public function contains(mixed $datum) { foreach ($this->values as $values) { if (in_array($datum, $values)) { diff --git a/src/Guard/ArrayOrTraversableGuardTrait.php b/src/Guard/ArrayOrTraversableGuardTrait.php index 962eba5f..692e9a7b 100644 --- a/src/Guard/ArrayOrTraversableGuardTrait.php +++ b/src/Guard/ArrayOrTraversableGuardTrait.php @@ -27,7 +27,7 @@ trait ArrayOrTraversableGuardTrait * @throws Exception */ protected function guardForArrayOrTraversable( - $data, + mixed $data, $dataName = 'Argument', $exceptionClass = InvalidArgumentException::class ) { diff --git a/src/Guard/EmptyGuardTrait.php b/src/Guard/EmptyGuardTrait.php index bffaa38a..e8d35cc1 100644 --- a/src/Guard/EmptyGuardTrait.php +++ b/src/Guard/EmptyGuardTrait.php @@ -24,7 +24,7 @@ trait EmptyGuardTrait * @throws Exception */ protected function guardAgainstEmpty( - $data, + mixed $data, $dataName = 'Argument', $exceptionClass = InvalidArgumentException::class ) { diff --git a/src/Guard/NullGuardTrait.php b/src/Guard/NullGuardTrait.php index 32ef3400..763c36b3 100644 --- a/src/Guard/NullGuardTrait.php +++ b/src/Guard/NullGuardTrait.php @@ -24,7 +24,7 @@ trait NullGuardTrait * @throws Exception */ protected function guardAgainstNull( - $data, + mixed $data, $dataName = 'Argument', $exceptionClass = InvalidArgumentException::class ) { diff --git a/src/ParameterObjectInterface.php b/src/ParameterObjectInterface.php index 60f531a6..b091c107 100644 --- a/src/ParameterObjectInterface.php +++ b/src/ParameterObjectInterface.php @@ -8,10 +8,9 @@ interface ParameterObjectInterface { /** * @param string $key - * @param mixed $value * @return void */ - public function __set($key, $value); + public function __set($key, mixed $value); /** * @param string $key diff --git a/src/PriorityList.php b/src/PriorityList.php index f4ecf9c9..8c50db25 100644 --- a/src/PriorityList.php +++ b/src/PriorityList.php @@ -65,11 +65,10 @@ class PriorityList implements Iterator, Countable * Insert a new item. * * @param string $name - * @param mixed $value * @param int $priority * @return void */ - public function insert($name, $value, $priority = 0) + public function insert($name, mixed $value, $priority = 0) { if (! isset($this->items[$name])) { $this->count++; @@ -162,7 +161,6 @@ protected function sort() * Compare the priority of two items. * * @param array $item1, - * @param array $item2 * @return int */ protected function compare(array $item1, array $item2) diff --git a/src/PriorityQueue.php b/src/PriorityQueue.php index e8aff2fe..0c77fad0 100644 --- a/src/PriorityQueue.php +++ b/src/PriorityQueue.php @@ -98,7 +98,7 @@ public function insert($data, $priority = 1) * @param mixed $datum * @return bool False if the item was not found, true otherwise. */ - public function remove($datum) + public function remove(mixed $datum) { $found = false; $key = null; diff --git a/test/ArrayUtilsTest.php b/test/ArrayUtilsTest.php index c1626763..caba777c 100644 --- a/test/ArrayUtilsTest.php +++ b/test/ArrayUtilsTest.php @@ -429,9 +429,8 @@ public function testValidArraysWithNumericKeys(array $test): void /** * @dataProvider invalidArrays - * @param mixed $test */ - public function testInvalidArraysAlwaysReturnFalse($test): void + public function testInvalidArraysAlwaysReturnFalse(mixed $test): void { self::assertFalse(ArrayUtils::hasStringKeys($test, false)); self::assertFalse(ArrayUtils::hasIntegerKeys($test, false)); @@ -507,9 +506,8 @@ public function testValidIteratorsReturnArrayRepresentation(iterable $test, arra /** * @dataProvider invalidIterators - * @param mixed $test */ - public function testInvalidIteratorsRaiseInvalidArgumentException($test): void + public function testInvalidIteratorsRaiseInvalidArgumentException(mixed $test): void { $this->expectException(InvalidArgumentException::class); self::assertFalse(ArrayUtils::iteratorToArray($test)); diff --git a/test/ConsoleHelperTest.php b/test/ConsoleHelperTest.php index 68a33417..1ec3847b 100644 --- a/test/ConsoleHelperTest.php +++ b/test/ConsoleHelperTest.php @@ -43,8 +43,7 @@ public function overrideEolSequence(string $newSequence): void $r->setValue($this->helper, $newSequence); } - /** @param mixed $stderr */ - public function overrideStderrResource($stderr): void + public function overrideStderrResource(mixed $stderr): void { $r = new ReflectionProperty($this->helper, 'stderr'); $r->setAccessible(true); diff --git a/test/StringUtilsTest.php b/test/StringUtilsTest.php index 8ba5d0ed..fd72a24b 100644 --- a/test/StringUtilsTest.php +++ b/test/StringUtilsTest.php @@ -155,10 +155,9 @@ public function getUtf8StringValidity(): array /** * @dataProvider getUtf8StringValidity - * @param mixed $str * @param bool $valid */ - public function testIsValidUtf8($str, $valid): void + public function testIsValidUtf8(mixed $str, $valid): void { self::assertSame($valid, StringUtils::isValidUtf8($str)); } diff --git a/test/StringWrapper/CommonStringWrapperTest.php b/test/StringWrapper/CommonStringWrapperTest.php index 56e19a9c..f95b072c 100644 --- a/test/StringWrapper/CommonStringWrapperTest.php +++ b/test/StringWrapper/CommonStringWrapperTest.php @@ -141,9 +141,8 @@ public function convertProvider(): array * @param string $str * @param string $encoding * @param string $convertEncoding - * @param mixed $expected */ - public function testConvert($encoding, $convertEncoding, $str, $expected): void + public function testConvert($encoding, $convertEncoding, $str, mixed $expected): void { $wrapper = $this->getWrapper($encoding, $convertEncoding); if (! $wrapper) { @@ -221,9 +220,8 @@ public function wordWrapProvider(): array * @param int $width * @param string $break * @param bool $cut - * @param mixed $expected */ - public function testWordWrap($encoding, $string, $width, $break, $cut, $expected): void + public function testWordWrap($encoding, $string, $width, $break, $cut, mixed $expected): void { $wrapper = $this->getWrapper($encoding); if (! $wrapper) { @@ -284,10 +282,9 @@ public function strPadProvider(): array * @param int $padLength * @param string $padString * @param int $padType - * @param mixed $expected * @group Laminas-12186 */ - public function testStrPad($encoding, $input, $padLength, $padString, $padType, $expected): void + public function testStrPad($encoding, $input, $padLength, $padString, $padType, mixed $expected): void { $wrapper = $this->getWrapper($encoding); if (! $wrapper) { diff --git a/test/TestAsset/GuardedObject.php b/test/TestAsset/GuardedObject.php index 0e579628..00c76836 100644 --- a/test/TestAsset/GuardedObject.php +++ b/test/TestAsset/GuardedObject.php @@ -10,26 +10,17 @@ class GuardedObject { use AllGuardsTrait; - /** - * @param mixed $value - */ - public function setArrayOrTraversable($value): void + public function setArrayOrTraversable(mixed $value): void { $this->guardForArrayOrTraversable($value); } - /** - * @param mixed $value - */ - public function setNotEmpty($value): void + public function setNotEmpty(mixed $value): void { $this->guardAgainstEmpty($value); } - /** - * @param mixed $value - */ - public function setNotNull($value): void + public function setNotNull(mixed $value): void { $this->guardAgainstNull($value); } diff --git a/test/TestAsset/TestOptions.php b/test/TestAsset/TestOptions.php index bf544006..660a64d7 100644 --- a/test/TestAsset/TestOptions.php +++ b/test/TestAsset/TestOptions.php @@ -23,10 +23,7 @@ class TestOptions extends AbstractOptions /** @var mixed */ protected $parentPublic; - /** - * @param mixed $value - */ - public function setTestField($value): void + public function setTestField(mixed $value): void { $this->testField = $value; } @@ -39,10 +36,8 @@ public function getTestField() /** * Needed to test accessibility of getters / setters within deriving classes - * - * @param mixed $parentPrivate */ - private function setParentPrivate($parentPrivate): void + private function setParentPrivate(mixed $parentPrivate): void { $this->parentPrivate = $parentPrivate; } @@ -59,10 +54,8 @@ private function getParentPrivate() /** * Needed to test accessibility of getters / setters within deriving classes - * - * @param mixed $parentProtected */ - protected function setParentProtected($parentProtected): void + protected function setParentProtected(mixed $parentProtected): void { $this->parentProtected = $parentProtected; } @@ -79,10 +72,8 @@ protected function getParentProtected() /** * Needed to test accessibility of getters / setters within deriving classes - * - * @param mixed $parentPublic */ - public function setParentPublic($parentPublic): void + public function setParentPublic(mixed $parentPublic): void { $this->parentPublic = $parentPublic; } diff --git a/test/TestAsset/TestOptionsDerived.php b/test/TestAsset/TestOptionsDerived.php index 07cf1631..54215d22 100644 --- a/test/TestAsset/TestOptionsDerived.php +++ b/test/TestAsset/TestOptionsDerived.php @@ -20,10 +20,8 @@ class TestOptionsDerived extends TestOptions /** * Needed to test accessibility of getters / setters within deriving classes - * - * @param mixed $derivedPrivate */ - private function setDerivedPrivate($derivedPrivate): void + private function setDerivedPrivate(mixed $derivedPrivate): void { $this->derivedPrivate = $derivedPrivate; } @@ -40,10 +38,8 @@ private function getDerivedPrivate() /** * Needed to test accessibility of getters / setters within deriving classes - * - * @param mixed $derivedProtected */ - protected function setDerivedProtected($derivedProtected): void + protected function setDerivedProtected(mixed $derivedProtected): void { $this->derivedProtected = $derivedProtected; } @@ -60,10 +56,8 @@ protected function getDerivedProtected() /** * Needed to test accessibility of getters / setters within deriving classes - * - * @param mixed $derivedPublic */ - public function setDerivedPublic($derivedPublic): void + public function setDerivedPublic(mixed $derivedPublic): void { $this->derivedPublic = $derivedPublic; } diff --git a/test/TestAsset/TestOptionsNoStrict.php b/test/TestAsset/TestOptionsNoStrict.php index 131d2dee..039d1095 100644 --- a/test/TestAsset/TestOptionsNoStrict.php +++ b/test/TestAsset/TestOptionsNoStrict.php @@ -21,10 +21,7 @@ class TestOptionsNoStrict extends AbstractOptions /** @var mixed */ protected $testField; - /** - * @param mixed $value - */ - public function setTestField($value): void + public function setTestField(mixed $value): void { $this->testField = $value; } diff --git a/test/TestAsset/TestOptionsWithoutGetter.php b/test/TestAsset/TestOptionsWithoutGetter.php index 13bdda0b..e0cfd5aa 100644 --- a/test/TestAsset/TestOptionsWithoutGetter.php +++ b/test/TestAsset/TestOptionsWithoutGetter.php @@ -14,10 +14,7 @@ class TestOptionsWithoutGetter extends AbstractOptions /** @var mixed */ protected $foo; - /** - * @param mixed $value - */ - public function setFoo($value): void + public function setFoo(mixed $value): void { $this->foo = $value; }