Skip to content
Merged

Fix CS #2349

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Phinx/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static function fromYaml(string $configFilePath): ConfigInterface
if (!is_array($configArray)) {
throw new RuntimeException(sprintf(
'File \'%s\' must be valid YAML',
$configFilePath
$configFilePath,
));
}

Expand All @@ -108,7 +108,7 @@ public static function fromJson(string $configFilePath): ConfigInterface
if (!is_array($configArray)) {
throw new RuntimeException(sprintf(
'File \'%s\' must be valid JSON',
$configFilePath
$configFilePath,
));
}

Expand All @@ -134,7 +134,7 @@ public static function fromPhp(string $configFilePath): ConfigInterface
if (!is_array($configArray)) {
throw new RuntimeException(sprintf(
'PHP file \'%s\' must return an array',
$configFilePath
$configFilePath,
));
}

Expand Down Expand Up @@ -212,7 +212,7 @@ public function getDefaultEnvironment(): string

throw new RuntimeException(sprintf(
'The environment configuration (read from $PHINX_ENVIRONMENT) for \'%s\' is missing',
$env
$env,
));
}

Expand All @@ -231,7 +231,7 @@ public function getDefaultEnvironment(): string

throw new RuntimeException(sprintf(
'The environment configuration for \'%s\' is missing',
$this->values['environments']['default_environment']
$this->values['environments']['default_environment'],
));
}

Expand Down
8 changes: 4 additions & 4 deletions src/Phinx/Console/Command/AbstractCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,14 +371,14 @@
if (!is_dir($path)) {
throw new InvalidArgumentException(sprintf(
'Migration directory "%s" does not exist',
$path
$path,

Check warning on line 374 in src/Phinx/Console/Command/AbstractCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Phinx/Console/Command/AbstractCommand.php#L374

Added line #L374 was not covered by tests
));
}

if (!is_writable($path)) {
throw new InvalidArgumentException(sprintf(
'Migration directory "%s" is not writable',
$path
$path,

Check warning on line 381 in src/Phinx/Console/Command/AbstractCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Phinx/Console/Command/AbstractCommand.php#L381

Added line #L381 was not covered by tests
));
}
}
Expand All @@ -395,14 +395,14 @@
if (!is_dir($path)) {
throw new InvalidArgumentException(sprintf(
'Seed directory "%s" does not exist',
$path
$path,

Check warning on line 398 in src/Phinx/Console/Command/AbstractCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Phinx/Console/Command/AbstractCommand.php#L398

Added line #L398 was not covered by tests
));
}

if (!is_writable($path)) {
throw new InvalidArgumentException(sprintf(
'Seed directory "%s" is not writable',
$path
$path,

Check warning on line 405 in src/Phinx/Console/Command/AbstractCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Phinx/Console/Command/AbstractCommand.php#L405

Added line #L405 was not covered by tests
));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Phinx/Console/Command/Breakpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function configure(): void
<info>phinx breakpoint -e development</info>
<info>phinx breakpoint -e development -t 20110103081132</info>
<info>phinx breakpoint -e development -r</info>
EOT
EOT,
);
}

Expand Down
24 changes: 12 additions & 12 deletions src/Phinx/Console/Command/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
->setHelp(sprintf(
'%sCreates a new database migration%s',
PHP_EOL,
PHP_EOL
PHP_EOL,
));

// An alternative template.
Expand Down Expand Up @@ -127,7 +127,7 @@
throw new Exception(
'You probably used curly braces to define migration path in your Phinx configuration file, ' .
'but no directories have been matched using this pattern. ' .
'You need to create a migration directory manually.'
'You need to create a migration directory manually.',

Check warning on line 130 in src/Phinx/Console/Command/Create.php

View check run for this annotation

Codecov / codecov/patch

src/Phinx/Console/Command/Create.php#L130

Added line #L130 was not covered by tests
);
}

Expand Down Expand Up @@ -179,7 +179,7 @@
if ($className !== null && in_array(strtolower($className), $this->keywords)) {
throw new InvalidArgumentException(sprintf(
'The migration class name "%s" is a reserved PHP keyword. Please choose a different class name.',
$className
$className,
));
}

Expand All @@ -195,7 +195,7 @@
if (!Util::isValidPhinxClassName($className)) {
throw new InvalidArgumentException(sprintf(
'The migration class name "%s" is invalid. Please use CamelCase format.',
$className
$className,

Check warning on line 198 in src/Phinx/Console/Command/Create.php

View check run for this annotation

Codecov / codecov/patch

src/Phinx/Console/Command/Create.php#L198

Added line #L198 was not covered by tests
));
}

Expand All @@ -207,7 +207,7 @@
throw new InvalidArgumentException(sprintf(
'The migration class name "%s%s" already exists',
$namespace ? $namespace . '\\' : '',
$className
$className,
));
}

Expand All @@ -216,7 +216,7 @@
if (is_file($filePath)) {
throw new InvalidArgumentException(sprintf(
'The file "%s" already exists',
$filePath
$filePath,

Check warning on line 219 in src/Phinx/Console/Command/Create.php

View check run for this annotation

Codecov / codecov/patch

src/Phinx/Console/Command/Create.php#L219

Added line #L219 was not covered by tests
));
}

Expand Down Expand Up @@ -253,7 +253,7 @@
if ($altTemplate && !is_file($altTemplate)) {
throw new InvalidArgumentException(sprintf(
'The alternative template file "%s" does not exist',
$altTemplate
$altTemplate,

Check warning on line 256 in src/Phinx/Console/Command/Create.php

View check run for this annotation

Codecov / codecov/patch

src/Phinx/Console/Command/Create.php#L256

Added line #L256 was not covered by tests
));
}

Expand All @@ -267,12 +267,12 @@
throw new InvalidArgumentException(sprintf(
'The class "%s" via the alias "%s" does not exist',
$aliasedClassName,
$creationClassName
$creationClassName,

Check warning on line 270 in src/Phinx/Console/Command/Create.php

View check run for this annotation

Codecov / codecov/patch

src/Phinx/Console/Command/Create.php#L270

Added line #L270 was not covered by tests
));
} elseif (!$aliasedClassName) {
throw new InvalidArgumentException(sprintf(
'The class "%s" does not exist',
$creationClassName
$creationClassName,

Check warning on line 275 in src/Phinx/Console/Command/Create.php

View check run for this annotation

Codecov / codecov/patch

src/Phinx/Console/Command/Create.php#L275

Added line #L275 was not covered by tests
));
}
}
Expand All @@ -282,14 +282,14 @@
throw new InvalidArgumentException(sprintf(
'The class "%s" does not implement the required interface "%s"',
$creationClassName,
self::CREATION_INTERFACE
self::CREATION_INTERFACE,
));
} elseif ($aliasedClassName && !is_subclass_of($aliasedClassName, self::CREATION_INTERFACE)) {
throw new InvalidArgumentException(sprintf(
'The class "%s" via the alias "%s" does not implement the required interface "%s"',
$aliasedClassName,
$creationClassName,
self::CREATION_INTERFACE
self::CREATION_INTERFACE,
));
}
}
Expand Down Expand Up @@ -321,7 +321,7 @@
if (file_put_contents($filePath, $contents) === false) {
throw new RuntimeException(sprintf(
'The file "%s" could not be written to',
$path
$path,

Check warning on line 324 in src/Phinx/Console/Command/Create.php

View check run for this annotation

Codecov / codecov/patch

src/Phinx/Console/Command/Create.php#L324

Added line #L324 was not covered by tests
));
}

Expand Down
16 changes: 8 additions & 8 deletions src/Phinx/Console/Command/Init.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@
'-f',
InputArgument::OPTIONAL,
'What format should we use to initialize?',
AbstractCommand::FORMAT_DEFAULT
AbstractCommand::FORMAT_DEFAULT,
)
->addArgument('path', InputArgument::OPTIONAL, 'Which path should we initialize for Phinx?')
->setHelp(sprintf(
'%sInitializes the application for Phinx%s',
PHP_EOL,
PHP_EOL
PHP_EOL,
));
}

Expand Down Expand Up @@ -94,7 +94,7 @@
if (!in_array($format, static::$supportedFormats, true)) {
throw new InvalidArgumentException(sprintf(
'Invalid format "%s". Format must be either ' . implode(', ', static::$supportedFormats) . '.',
$format
$format,
));
}

Expand All @@ -118,14 +118,14 @@
if (is_file($path)) {
throw new InvalidArgumentException(sprintf(
'Config file "%s" already exists.',
$path
$path,
));
}

// Dir is invalid
throw new InvalidArgumentException(sprintf(
'Invalid path "%s" for config file.',
$path
$path,
));
}

Expand All @@ -145,7 +145,7 @@
if (!is_writable($dirname)) {
throw new InvalidArgumentException(sprintf(
'The directory "%s" is not writable',
$dirname
$dirname,

Check warning on line 148 in src/Phinx/Console/Command/Init.php

View check run for this annotation

Codecov / codecov/patch

src/Phinx/Console/Command/Init.php#L148

Added line #L148 was not covered by tests
));
}

Expand All @@ -159,14 +159,14 @@
} else {
throw new RuntimeException(sprintf(
'Could not find template for format "%s".',
$format
$format,

Check warning on line 162 in src/Phinx/Console/Command/Init.php

View check run for this annotation

Codecov / codecov/patch

src/Phinx/Console/Command/Init.php#L162

Added line #L162 was not covered by tests
));
}

if (file_put_contents($path, $contents) === false) {
throw new RuntimeException(sprintf(
'The file "%s" could not be written to',
$path
$path,

Check warning on line 169 in src/Phinx/Console/Command/Init.php

View check run for this annotation

Codecov / codecov/patch

src/Phinx/Console/Command/Init.php#L169

Added line #L169 was not covered by tests
));
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/Phinx/Console/Command/ListAliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@ function ($alias, $class) use ($maxAliasLength, $maxClassLength) {
return sprintf('%s %s', str_pad($alias, $maxAliasLength), str_pad($class, $maxClassLength));
},
array_keys($aliases),
$aliases
)
$aliases,
),
),
$this->verbosityLevel
$this->verbosityLevel,
);
} else {
$output->writeln(
'<comment>warning</comment> no aliases defined in ' . Util::relativePath(
$this->config->getConfigFilePath()
$this->config->getConfigFilePath(),
),
$this->verbosityLevel
$this->verbosityLevel,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Phinx/Console/Command/Migrate.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected function configure(): void
<info>phinx migrate -e development -d 20110103</info>
<info>phinx migrate -e development -v</info>

EOT
EOT,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Phinx/Console/Command/Rollback.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected function configure(): void
This can be used to allow the rolling back of the last executed migration instead of the last created one, or combined
with the <info>-d|--date</info> option to rollback to a certain date using the migration start times to order them.

EOT
EOT,
);
}

Expand Down
14 changes: 7 additions & 7 deletions src/Phinx/Console/Command/SeedCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
->setHelp(sprintf(
'%sCreates a new database seeder%s',
PHP_EOL,
PHP_EOL
PHP_EOL,
));

// An alternative template.
Expand Down Expand Up @@ -104,7 +104,7 @@
throw new Exception(
'You probably used curly braces to define seed path in your Phinx configuration file, ' .
'but no directories have been matched using this pattern. ' .
'You need to create a seed directory manually.'
'You need to create a seed directory manually.',

Check warning on line 107 in src/Phinx/Console/Command/SeedCreate.php

View check run for this annotation

Codecov / codecov/patch

src/Phinx/Console/Command/SeedCreate.php#L107

Added line #L107 was not covered by tests
);
}

Expand Down Expand Up @@ -155,7 +155,7 @@
if (!Util::isValidPhinxClassName($className)) {
throw new InvalidArgumentException(sprintf(
'The seed class name "%s" is invalid. Please use CamelCase format',
$className
$className,
));
}

Expand All @@ -165,7 +165,7 @@
if (is_file($filePath)) {
throw new InvalidArgumentException(sprintf(
'The file "%s" already exists',
basename($filePath)
basename($filePath),
));
}

Expand All @@ -176,7 +176,7 @@
if ($altTemplate && !is_file($altTemplate)) {
throw new InvalidArgumentException(sprintf(
'The template file "%s" does not exist',
$altTemplate
$altTemplate,
));
}

Expand All @@ -187,7 +187,7 @@
if (!is_null($altTemplate) && !is_file($altTemplate)) {
throw new InvalidArgumentException(sprintf(
'The template file `%s` from config does not exist',
$altTemplate
$altTemplate,
));
}
}
Expand All @@ -209,7 +209,7 @@
if (file_put_contents($filePath, $contents) === false) {
throw new RuntimeException(sprintf(
'The file "%s" could not be written to',
$path
$path,

Check warning on line 212 in src/Phinx/Console/Command/SeedCreate.php

View check run for this annotation

Codecov / codecov/patch

src/Phinx/Console/Command/SeedCreate.php#L212

Added line #L212 was not covered by tests
));
}

Expand Down
2 changes: 1 addition & 1 deletion src/Phinx/Console/Command/SeedRun.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function configure(): void
<info>phinx seed:run -e development -s UserSeeder -s PermissionSeeder -s LogSeeder</info>
<info>phinx seed:run -e development -v</info>

EOT
EOT,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Phinx/Console/Command/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected function configure(): void
<info>phinx status -e development -f json</info>

The <info>version_order</info> configuration option is used to determine the order of the status migrations.
EOT
EOT,
);
}

Expand Down
Loading
Loading