Skip to content

New command: app:new:from:drupal7 #1814

New command: app:new:from:drupal7

New command: app:new:from:drupal7 #1814

Triggered via pull request August 8, 2023 15:36
Status Success
Total duration 5m 13s
Artifacts

mutation.yml

on: pull_request
Mutation Testing
5m 1s
Mutation Testing
Fit to window
Zoom out
Zoom in

Annotations

10 warnings
Mutation Testing: src/Command/App/From/Composer/ProjectBuilder.php#L69
Escaped Mutant for Mutator "InstanceOf_": --- Original +++ New @@ @@ // Add recommended dependencies and patches, if any. foreach ($this->resolver->getRecommendations() as $recommendation) { assert($recommendation instanceof RecommendationInterface); - if ($recommendation instanceof NormalizableInterface) { + if (true) { $recommendations[] = $recommendation->normalize(); } if ($recommendation instanceof AbandonmentRecommendation) {
Mutation Testing: src/Command/App/From/Composer/ProjectBuilder.php#L109
Escaped Mutant for Mutator "LogicalAnd": --- Original +++ New @@ @@ if ($recommendation->hasPatches()) { $composer_json['extra']['patches'][$recommended_package_name] = $recommendation->getPatches(); } - if ($recommendation->isVetted() && $recommendation->hasModulesToInstall()) { + if ($recommendation->isVetted() || $recommendation->hasModulesToInstall()) { array_push($modules_to_install, ...$recommendation->getModulesToInstall()); } }
Mutation Testing: src/Command/App/From/Composer/ProjectBuilder.php#L126
Escaped Mutant for Mutator "UnwrapArrayValues": --- Original +++ New @@ @@ if (isset($composer_json['extra']['patches'])) { ksort($composer_json['extra']['patches']); } - $source_modules = array_values(array_map(function (ExtensionInterface $module) { + $source_modules = array_map(function (ExtensionInterface $module) { // phpcs:disable SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys return ['name' => $module->getName(), 'humanName' => $module->getHumanName(), 'version' => $module->getVersion()]; // phpcs:enable - }, $this->siteInspector->getExtensions(SiteInspectorInterface::FLAG_EXTENSION_MODULE | SiteInspectorInterface::FLAG_EXTENSION_ENABLED))); + }, $this->siteInspector->getExtensions(SiteInspectorInterface::FLAG_EXTENSION_MODULE | SiteInspectorInterface::FLAG_EXTENSION_ENABLED)); $module_names = array_column($source_modules, 'name'); array_multisort($module_names, SORT_STRING, $source_modules); $recommendation_ids = array_column($recommendations, 'id');
Mutation Testing: src/Command/App/From/Composer/ProjectBuilder.php#L136
Escaped Mutant for Mutator "FunctionCallRemoval": --- Original +++ New @@ @@ // phpcs:enable }, $this->siteInspector->getExtensions(SiteInspectorInterface::FLAG_EXTENSION_MODULE | SiteInspectorInterface::FLAG_EXTENSION_ENABLED))); $module_names = array_column($source_modules, 'name'); - array_multisort($module_names, SORT_STRING, $source_modules); + $recommendation_ids = array_column($recommendations, 'id'); array_multisort($recommendation_ids, SORT_STRING, $recommendations); // phpcs:disable SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys
Mutation Testing: src/Command/App/From/Configuration.php#L30
Escaped Mutant for Mutator "ProtectedVisibility": --- Original +++ New @@ @@ * @param array $config * An array of configuration, usually parsed from a configuration file. */ - protected function __construct(array $config) + private function __construct(array $config) { $this->array = static::schema(['rootPackageDefinition' => 'is_array'])($config); }
Mutation Testing: src/Command/App/From/JsonResourceParserTrait.php#L20
Escaped Mutant for Mutator "ProtectedVisibility": --- Original +++ New @@ @@ * @return mixed * The decoded JSON, usually an array. */ - protected static function parseJsonResource($resource) : mixed + private static function parseJsonResource($resource) : mixed { assert(is_resource($resource)); $json = stream_get_contents($resource);
Mutation Testing: src/Command/App/From/Recommendation/AbandonmentRecommendation.php#L48
Escaped Mutant for Mutator "ProtectedVisibility": --- Original +++ New @@ @@ * @param array $definition * The original decoded definition. */ - protected function __construct(Closure $extension_evaluator, array $definition) + private function __construct(Closure $extension_evaluator, array $definition) { $this->evaluateExtension = $extension_evaluator; $this->definition = $definition;
Mutation Testing: src/Command/App/From/Recommendation/AbandonmentRecommendation.php#L66
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ public static function createFromDefinition(mixed $definition) : RecommendationInterface { // phpcs:disable SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys - $validator = static::schema(['package' => 'is_null', 'note' => 'is_string', 'replaces' => static::schema(['name' => 'is_string']), 'vetted' => 'is_bool']); + $validator = static::schema(['note' => 'is_string', 'replaces' => static::schema(['name' => 'is_string']), 'vetted' => 'is_bool']); // phpcs:enable try { $validated = $validator($definition);
Mutation Testing: src/Command/App/From/Recommendation/DefinedRecommendation.php#L123
Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ public static function createFromDefinition(mixed $definition) : RecommendationInterface { // phpcs:disable SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys - $defaults = ['universal' => FALSE, 'patches' => [], 'install' => [], 'vetted' => FALSE, 'note' => static::NOTE_PLACEHOLDER_STRING]; + $defaults = ['universal' => FALSE, 'patches' => [], 'install' => [], 'vetted' => true, 'note' => static::NOTE_PLACEHOLDER_STRING]; $validate_if_universal_is_false = Closure::fromCallable(function ($context) { return $context['universal'] === FALSE; });
Mutation Testing: src/Command/App/From/Recommendation/Recommendations.php#L42
Escaped Mutant for Mutator "UnwrapArrayFilter": --- Original +++ New @@ @@ if (!is_array($config_recommendations)) { return new static([]); } - return new static(array_filter(array_map(function ($config) { + return new static(array_map(function ($config) { return DefinedRecommendation::createFromDefinition($config); - }, $config_recommendations), function (RecommendationInterface $recommendation) { - return !$recommendation instanceof NoRecommendation; - })); + }, $config_recommendations)); } }