Skip to content

Add ArrayHelper::iterableToArray() #637

Add ArrayHelper::iterableToArray()

Add ArrayHelper::iterableToArray() #637

Triggered via pull request April 10, 2025 07:07
Status Success
Total duration 1m 27s
Artifacts

mutation.yml

on: pull_request
Matrix: mutation / roave-infection
Fit to window
Zoom out
Zoom in

Annotations

10 warnings
mutation / PHP 8.4-ubuntu-latest: src/ArrayHelper.php#L1357
Escaped Mutant for Mutator "Continue_": @@ @@ $numNestedKeys = count($keys) - 1; foreach ($keys as $i => $key) { if (!is_array($excludeNode) || !array_key_exists($key, $excludeNode)) { - continue 2; + break; // Jump to the next filter. } if ($i < $numNestedKeys) {
mutation / PHP 8.4-ubuntu-latest: src/ArrayHelper.php#L1357
Escaped Mutant for Mutator "DecrementInteger": @@ @@ $numNestedKeys = count($keys) - 1; foreach ($keys as $i => $key) { if (!is_array($excludeNode) || !array_key_exists($key, $excludeNode)) { - continue 2; + continue 1; // Jump to the next filter. } if ($i < $numNestedKeys) {
mutation / PHP 8.4-ubuntu-latest: src/ArrayHelper.php#L1053
Escaped Mutant for Mutator "AssignCoalesce": @@ @@ public static function htmlEncode(iterable $data, bool $valuesOnly = true, ?string $encoding = null): array { $data = self::iterableToArray($data); - $encoding ??= ini_get('default_charset') ?: 'UTF-8'; + $encoding = ini_get('default_charset') ?: 'UTF-8'; $flags = ENT_QUOTES | ENT_SUBSTITUTE; return $valuesOnly ? self::htmlEncodeValues($data, $flags, $encoding) : self::htmlEncodeKeysAndValues($data, $flags, $encoding); }
mutation / PHP 8.4-ubuntu-latest: src/ArrayHelper.php#L1026
Escaped Mutant for Mutator "TrueValue": @@ @@ * * @psalm-param ArrayPath $path */ - public static function pathExists(array $array, array|float|int|string $path, bool $caseSensitive = true, string $delimiter = '.'): bool + public static function pathExists(array $array, array|float|int|string $path, bool $caseSensitive = false, string $delimiter = '.'): bool { return self::keyExists($array, self::parseMixedPath($path, $delimiter), $caseSensitive); }
mutation / PHP 8.4-ubuntu-latest: src/ArrayHelper.php#L947
Escaped Mutant for Mutator "TrueValue": @@ @@ * * @return bool Whether the array contains the specified key. */ - public static function keyExists(array $array, array|float|int|string $key, bool $caseSensitive = true): bool + public static function keyExists(array $array, array|float|int|string $key, bool $caseSensitive = false): bool { if (is_array($key)) { if (empty($key)) {
mutation / PHP 8.4-ubuntu-latest: src/ArrayHelper.php#L758
Escaped Mutant for Mutator "ConcatOperandRemoval": @@ @@ /** @var mixed $element */ foreach ($array as $element) { if (!is_array($element) && !is_object($element)) { - throw new InvalidArgumentException('index() can not get value from ' . gettype($element) . '. The $array should be either multidimensional array or an array of objects.'); + throw new InvalidArgumentException('index() can not get value from ' . gettype($element)); } $lastArray =& $result; foreach ($groups as $group) {
mutation / PHP 8.4-ubuntu-latest: src/ArrayHelper.php#L758
Escaped Mutant for Mutator "Concat": @@ @@ /** @var mixed $element */ foreach ($array as $element) { if (!is_array($element) && !is_object($element)) { - throw new InvalidArgumentException('index() can not get value from ' . gettype($element) . '. The $array should be either multidimensional array or an array of objects.'); + throw new InvalidArgumentException('index() can not get value from ' . '. The $array should be either multidimensional array or an array of objects.' . gettype($element)); } $lastArray =& $result; foreach ($groups as $group) {
mutation / PHP 8.4-ubuntu-latest: src/ArrayHelper.php#L758
Escaped Mutant for Mutator "ConcatOperandRemoval": @@ @@ /** @var mixed $element */ foreach ($array as $element) { if (!is_array($element) && !is_object($element)) { - throw new InvalidArgumentException('index() can not get value from ' . gettype($element) . '. The $array should be either multidimensional array or an array of objects.'); + throw new InvalidArgumentException('index() can not get value from ' . '. The $array should be either multidimensional array or an array of objects.'); } $lastArray =& $result; foreach ($groups as $group) {
mutation / PHP 8.4-ubuntu-latest: src/ArrayHelper.php#L758
Escaped Mutant for Mutator "ConcatOperandRemoval": @@ @@ /** @var mixed $element */ foreach ($array as $element) { if (!is_array($element) && !is_object($element)) { - throw new InvalidArgumentException('index() can not get value from ' . gettype($element) . '. The $array should be either multidimensional array or an array of objects.'); + throw new InvalidArgumentException(gettype($element) . '. The $array should be either multidimensional array or an array of objects.'); } $lastArray =& $result; foreach ($groups as $group) {
mutation / PHP 8.4-ubuntu-latest: src/ArrayHelper.php#L758
Escaped Mutant for Mutator "Concat": @@ @@ /** @var mixed $element */ foreach ($array as $element) { if (!is_array($element) && !is_object($element)) { - throw new InvalidArgumentException('index() can not get value from ' . gettype($element) . '. The $array should be either multidimensional array or an array of objects.'); + throw new InvalidArgumentException(gettype($element) . 'index() can not get value from ' . '. The $array should be either multidimensional array or an array of objects.'); } $lastArray =& $result; foreach ($groups as $group) {