Some code refresh #137
Annotations
10 warnings
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)]);
}
}
|
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.');
}
|
src/controllers/MigrationController.php#L960
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
$foundCollision = false;
foreach ($folders as $folder) {
if ($handle = \opendir($folder)) {
- while (($file = \readdir($handle)) !== false) {
+ while (($file = \readdir($handle)) !== true) {
if ($file === '.' || $file === '..') {
continue;
}
|
src/renderers/BlueprintRenderer.php#L75
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
* Renders the blueprint for down().
* @see https://www.yiiframework.com/doc/api/2.0/yii-db-migration#down()-detail
*/
- public function renderDown(BlueprintInterface $blueprint, int $indent = 0, string $schema = null, string $engineVersion = null, bool $usePrefix = true, string $dbPrefix = null) : string
+ public function renderDown(BlueprintInterface $blueprint, int $indent = 0, string $schema = null, string $engineVersion = null, bool $usePrefix = false, string $dbPrefix = null) : string
{
$tableName = $this->renderName($blueprint->getTableName(), $usePrefix, $dbPrefix);
$renderedBlueprint = \array_filter([$this->renderIndexesToDrop($blueprint, $tableName, $indent, true), $this->renderPrimaryKeyToDrop($blueprint, $tableName, $indent, $schema, true), $this->renderForeignKeysToDrop($blueprint, $tableName, $indent, $schema, true), $this->renderColumnsToDrop($blueprint, $tableName, $indent, true), $this->renderPrimaryKeyToAdd($blueprint, $tableName, $indent, $schema, true), $this->renderColumnsToAdd($blueprint, $tableName, $indent, $schema, $engineVersion, true), $this->renderColumnsToAlter($blueprint, $tableName, $indent, $schema, $engineVersion, true), $this->renderIndexesToAdd($blueprint, $tableName, $indent, true), $this->renderForeignKeysToAdd($blueprint, $tableName, $indent, $schema, $usePrefix, $dbPrefix, true)]);
|
src/renderers/BlueprintRenderer.php#L180
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
/**
* Renders alter columns statements.
*/
- private function renderColumnsToAlter(BlueprintInterface $blueprint, string $tableName, int $indent = 0, string $schema = null, string $engineVersion = null, bool $inverse = false) : ?string
+ private function renderColumnsToAlter(BlueprintInterface $blueprint, string $tableName, int $indent = -1, string $schema = null, string $engineVersion = null, bool $inverse = false) : ?string
{
$renderedColumns = [];
if ($inverse) {
|
src/renderers/BlueprintRenderer.php#L340
Escaped Mutant for Mutator "DecrementInteger":
--- 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();
|
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;
|
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;
}
}
|
src/renderers/ColumnRenderer.php#L276
Escaped Mutant for Mutator "UnwrapTrim":
--- Original
+++ New
@@ @@
$schemaAppend = $column->prepareSchemaAppend(true, $column->isAutoIncrement(), $schema);
if ($schemaAppend !== null) {
if (!empty($columnAppend)) {
- $schemaAppend .= ' ' . \trim(\str_replace($schemaAppend, '', $columnAppend));
+ $schemaAppend .= ' ' . \str_replace($schemaAppend, '', $columnAppend);
}
$schemaAppend = \trim($schemaAppend);
}
|
src/renderers/ColumnRenderer.php#L282
Escaped Mutant for Mutator "UnwrapTrim":
--- Original
+++ New
@@ @@
}
$this->definition[] = "append('" . $this->escapeQuotes($schemaAppend) . "')";
} elseif (!empty($columnAppend)) {
- $this->definition[] = "append('" . $this->escapeQuotes(\trim($columnAppend)) . "')";
+ $this->definition[] = "append('" . $this->escapeQuotes($columnAppend) . "')";
}
$comment = $column->getComment();
if ($comment) {
|
The logs for this run have expired and are no longer available.
Loading