Skip to content

Merge pull request #183 from bizley/code-refresh #138

Merge pull request #183 from bizley/code-refresh

Merge pull request #183 from bizley/code-refresh #138

Triggered via push September 5, 2023 15:43
Status Success
Total duration 1h 55m 9s
Artifacts

mutation.yml

on: push
Matrix: Tests
Fit to window
Zoom out
Zoom in

Annotations

10 warnings
PHP 8.1 + Infection: src/Updater.php#L93
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ * Generates migration based on the blueprint. * @throws NotSupportedException */ - public function generateFromBlueprint(BlueprintInterface $blueprint, string $migrationName, bool $usePrefix = true, string $dbPrefix = '', string $namespace = null) : string + public function generateFromBlueprint(BlueprintInterface $blueprint, string $migrationName, bool $usePrefix = false, string $dbPrefix = '', string $namespace = null) : string { return $this->view->renderFile($this->getUpdateTableMigrationTemplate(), ['className' => $migrationName, 'namespace' => $this->getNormalizedNamespace($namespace), 'bodyUp' => $this->blueprintRenderer->renderUp($blueprint, 8, $this->tableMapper->getSchemaType(), $this->tableMapper->getEngineVersion(), $usePrefix, $dbPrefix), 'bodyDown' => $this->blueprintRenderer->renderDown($blueprint, 8, $this->tableMapper->getSchemaType(), $this->tableMapper->getEngineVersion(), $usePrefix, $dbPrefix)]); } }
PHP 8.1 + Infection: src/controllers/BaseMigrationController.php#L279
Escaped Mutant for Mutator "CloneRemoval": --- Original +++ New @@ @@ if ($this->extractor === null) { $db = Instance::ensure($this->db, Connection::class); // cloning connection here to not force reconnecting on each extraction - $configuredObject = Yii::createObject($this->extractorClass, [clone $db, $this->experimental]); + $configuredObject = Yii::createObject($this->extractorClass, [$db, $this->experimental]); if (!$configuredObject instanceof ExtractorInterface) { throw new InvalidConfigException('Extractor must implement bizley\\migration\\ExtractorInterface.'); }
PHP 8.1 + Infection: src/controllers/MigrationController.php#L967
Escaped Mutant for Mutator "GreaterThanOrEqualTo": --- Original +++ New @@ @@ $path = $folder . DIRECTORY_SEPARATOR . $file; if (\is_file($path) && \preg_match('/m(\\d{6}_?\\d{6})\\D.*?/i', $file, $matches)) { $time = \str_replace('_', '', $matches[1]); - if ($time >= $nowDate && $time <= $lastTimestampDate) { + if ($time > $nowDate && $time <= $lastTimestampDate) { $foundCollision = true; break; }
PHP 8.1 + Infection: src/controllers/MigrationController.php#L967
Escaped Mutant for Mutator "GreaterThanOrEqualToNegotiation": --- Original +++ New @@ @@ $path = $folder . DIRECTORY_SEPARATOR . $file; if (\is_file($path) && \preg_match('/m(\\d{6}_?\\d{6})\\D.*?/i', $file, $matches)) { $time = \str_replace('_', '', $matches[1]); - if ($time >= $nowDate && $time <= $lastTimestampDate) { + if ($time < $nowDate && $time <= $lastTimestampDate) { $foundCollision = true; break; }
PHP 8.1 + Infection: src/controllers/MigrationController.php#L967
Escaped Mutant for Mutator "LessThanOrEqualTo": --- Original +++ New @@ @@ $path = $folder . DIRECTORY_SEPARATOR . $file; if (\is_file($path) && \preg_match('/m(\\d{6}_?\\d{6})\\D.*?/i', $file, $matches)) { $time = \str_replace('_', '', $matches[1]); - if ($time >= $nowDate && $time <= $lastTimestampDate) { + if ($time >= $nowDate && $time < $lastTimestampDate) { $foundCollision = true; break; }
PHP 8.1 + Infection: src/controllers/MigrationController.php#L967
Escaped Mutant for Mutator "LessThanOrEqualToNegotiation": --- Original +++ New @@ @@ $path = $folder . DIRECTORY_SEPARATOR . $file; if (\is_file($path) && \preg_match('/m(\\d{6}_?\\d{6})\\D.*?/i', $file, $matches)) { $time = \str_replace('_', '', $matches[1]); - if ($time >= $nowDate && $time <= $lastTimestampDate) { + if ($time >= $nowDate && $time > $lastTimestampDate) { $foundCollision = true; break; }
PHP 8.1 + Infection: src/controllers/MigrationController.php#L967
Escaped Mutant for Mutator "LogicalAnd": --- Original +++ New @@ @@ $path = $folder . DIRECTORY_SEPARATOR . $file; if (\is_file($path) && \preg_match('/m(\\d{6}_?\\d{6})\\D.*?/i', $file, $matches)) { $time = \str_replace('_', '', $matches[1]); - if ($time >= $nowDate && $time <= $lastTimestampDate) { + if ($time >= $nowDate || $time <= $lastTimestampDate) { $foundCollision = true; break; }
PHP 8.1 + Infection: src/renderers/BlueprintRenderer.php#L340
Escaped Mutant for Mutator "IncrementInteger": --- Original +++ New @@ @@ /** * Renders add primary key statement. */ - private function renderPrimaryKeyToAdd(BlueprintInterface $blueprint, string $tableName, int $indent = 0, string $schema = null, bool $inverse = false) : ?string + private function renderPrimaryKeyToAdd(BlueprintInterface $blueprint, string $tableName, int $indent = 1, string $schema = null, bool $inverse = false) : ?string { if ($inverse) { $primaryKey = $blueprint->getDroppedPrimaryKey();
PHP 8.1 + Infection: src/renderers/ColumnRenderer.php#L183
Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ $definition = $column->getDefinition(); if ($this->generalSchema) { if ($column instanceof PrimaryKeyColumnInterface) { - $this->isPrimaryKeyPossible = false; + $this->isPrimaryKeyPossible = true; $this->isNotNullPossible = false; } elseif ($column instanceof PrimaryKeyVariantColumnInterface && $primaryKey && !$primaryKey->isComposite() && $column->isColumnInPrimaryKey($primaryKey)) { $this->isPrimaryKeyPossible = false;
PHP 8.1 + Infection: src/renderers/ColumnRenderer.php#L202
Escaped Mutant for Mutator "UnwrapStrReplace": --- Original +++ New @@ @@ if ($this->generalSchema) { $alias = Schema::getAlias($schema, $type, (string) $length); if ($alias !== null) { - $this->definition[] = \str_replace('{renderLength}', '', $alias); + $this->definition[] = $alias; return; } }