Implement value retrieval and checks by predicate callback #602
Annotations
5 warnings
Run roave infection.:
src/ArrayableTrait.php#L191
Escaped Mutant for Mutator "ProtectedVisibility":
--- Original
+++ New
@@ @@
*
* @return string[] Root fields extracted from the given nested fields.
*/
- protected function extractRootFields(array $fields) : array
+ private function extractRootFields(array $fields) : array
{
$result = [];
foreach ($fields as $field) {
|
Run roave infection.:
src/ArrayableTrait.php#L204
Escaped Mutant for Mutator "UnwrapArrayUnique":
--- Original
+++ New
@@ @@
if (in_array('*', $result, true)) {
$result = [];
}
- return array_unique($result);
+ return $result;
}
/**
* Extract nested fields from a fields collection for a given root field
|
Run roave infection.:
src/ArrayableTrait.php#L217
Escaped Mutant for Mutator "ProtectedVisibility":
--- Original
+++ New
@@ @@
*
* @return string[] Nested fields extracted for the given field.
*/
- protected function extractFieldsFor(array $fields, string $rootField) : array
+ private function extractFieldsFor(array $fields, string $rootField) : array
{
$result = [];
foreach ($fields as $field) {
|
Run roave infection.:
src/ArrayableTrait.php#L227
Escaped Mutant for Mutator "UnwrapArrayUnique":
--- Original
+++ New
@@ @@
$result[] = substr($field, strlen($rootField) + 1);
}
}
- return array_unique($result);
+ return $result;
}
/**
* Determines which fields can be returned by {@see ArrayableInterface::toArray()}.
|
Run roave infection.:
src/ArrayableTrait.php#L244
Escaped Mutant for Mutator "ProtectedVisibility":
--- Original
+++ New
@@ @@
*
* @psalm-return array<string, string|CallableFieldDefinition>
*/
- protected function resolveFields(array $fields, array $expand) : array
+ private function resolveFields(array $fields, array $expand) : array
{
$fields = $this->extractRootFields($fields);
$expand = $this->extractRootFields($expand);
|
Loading