Skip to content

Performance optimizations #626

Performance optimizations

Performance optimizations #626

Triggered via pull request February 9, 2025 23:18
@samdarksamdark
synchronize #168
performance
Status Success
Total duration 1m 34s
Artifacts

mutation.yml

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

Annotations

5 warnings
mutation / PHP 8.4-ubuntu-latest: src/ArrayableTrait.php#L191
Escaped Mutant for Mutator "ProtectedVisibility": @@ @@ * * @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) {
mutation / PHP 8.4-ubuntu-latest: src/ArrayableTrait.php#L204
Escaped Mutant for Mutator "UnwrapArrayUnique": @@ @@ if (in_array('*', $result, true)) { $result = []; } - return array_unique($result); + return $result; } /** * Extract nested fields from a fields collection for a given root field
mutation / PHP 8.4-ubuntu-latest: src/ArrayableTrait.php#L217
Escaped Mutant for Mutator "ProtectedVisibility": @@ @@ * * @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) {
mutation / PHP 8.4-ubuntu-latest: src/ArrayableTrait.php#L227
Escaped Mutant for Mutator "UnwrapArrayUnique": @@ @@ $result[] = substr($field, strlen($rootField) + 1); } } - return array_unique($result); + return $result; } /** * Determines which fields can be returned by {@see ArrayableInterface::toArray()}.
mutation / PHP 8.4-ubuntu-latest: src/ArrayableTrait.php#L244
Escaped Mutant for Mutator "ProtectedVisibility": @@ @@ * * @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);