Merge pull request #183 from bizley/code-refresh #138
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#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;
}
|
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;
}
|
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;
}
|
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;
}
|
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;
}
|
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();
|
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;
}
}
|
The logs for this run have expired and are no longer available.
Loading