Skip to content
Merged
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
2 changes: 1 addition & 1 deletion bin/doctrine-migrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use function is_readable;
use function trigger_error;

(function () : void {
(static function () : void {
$autoloadFiles = [
__DIR__ . '/../vendor/autoload.php',
__DIR__ . '/../../../autoload.php',
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"require-dev": {
"ext-pdo_sqlite": "*",
"doctrine/coding-standard": "^4.0",
"doctrine/coding-standard": "^5.0",
"doctrine/orm": "^2.6",
"jdorn/sql-formatter": "^1.1",
"mikey179/vfsStream": "^1.6",
Expand Down
51 changes: 27 additions & 24 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
*/
abstract class AbstractFileConfiguration extends Configuration
{
/** @var array */
private const ALLOWED_CONFIGURATION_KEYS = [
'migrations_namespace',
'table_name',
Expand Down Expand Up @@ -111,7 +110,7 @@ protected function getDirectoryRelativeToFile(string $file, string $input) : str
{
$path = realpath(dirname($file) . '/' . $input);

return ($path !== false) ? $path : $input;
return $path !== false ? $path : $input;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
class ArrayConnectionConfigurationLoader implements ConnectionLoaderInterface
{
/** @var null|string */
/** @var string|null */
private $filename;

public function __construct(?string $filename)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
class ConnectionConfigurationLoader implements ConnectionLoaderInterface
{
/** @var null|Configuration */
/** @var Configuration|null */
private $configuration;

public function __construct(?Configuration $configuration = null)
Expand Down
6 changes: 3 additions & 3 deletions lib/Doctrine/Migrations/DependencyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public function getQueryWriter() : FileQueryWriter

public function getOutputWriter() : OutputWriter
{
return $this->getDependency(OutputWriter::class, function () : OutputWriter {
return $this->getDependency(OutputWriter::class, static function () : OutputWriter {
return new OutputWriter();
});
}
Expand All @@ -203,7 +203,7 @@ public function getMigrationPlanCalculator() : MigrationPlanCalculator

public function getRecursiveRegexFinder() : RecursiveRegexFinder
{
return $this->getDependency(RecursiveRegexFinder::class, function () : RecursiveRegexFinder {
return $this->getDependency(RecursiveRegexFinder::class, static function () : RecursiveRegexFinder {
return new RecursiveRegexFinder();
});
}
Expand Down Expand Up @@ -249,7 +249,7 @@ public function getMigrator() : Migrator

public function getStopwatch() : Stopwatch
{
return $this->getDependency(Stopwatch::class, function () : Stopwatch {
return $this->getDependency(Stopwatch::class, static function () : Stopwatch {
$symfonyStopwatch = new SymfonyStopwatch(true);

return new Stopwatch($symfonyStopwatch);
Expand Down
6 changes: 3 additions & 3 deletions lib/Doctrine/Migrations/FileQueryWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
final class FileQueryWriter implements QueryWriter
{
/** @var null|OutputWriter */
/** @var OutputWriter|null */
private $outputWriter;

/** @var FileBuilder */
Expand Down Expand Up @@ -60,8 +60,8 @@ public function write(
private function buildMigrationFilePath(string $path, DateTimeInterface $now) : string
{
if (is_dir($path)) {
$path = realpath($path);
$path = $path . '/doctrine_migration_' . $now->format('YmdHis') . '.sql';
$path = realpath($path);
$path .= '/doctrine_migration_' . $now->format('YmdHis') . '.sql';
}

return $path;
Expand Down
1 change: 1 addition & 0 deletions lib/Doctrine/Migrations/Finder/Finder.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ protected function loadMigrations(array $files, ?string $namespace) : array
*
* @param string[] $files The set of files that were `required`
* @param string|null $namespace If not null only classes in this namespace will be returned
*
* @return ReflectionClass[] the classes in `$files`
*/
protected function loadMigrationClasses(array $files, ?string $namespace) : array
Expand Down
1 change: 1 addition & 0 deletions lib/Doctrine/Migrations/Finder/MigrationFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ interface MigrationFinder
/**
* @param string $directory The directory which the finder should search
* @param string|null $namespace If not null only classes in this namespace will be returned
*
* @return string[]
*/
public function findMigrations(string $directory, ?string $namespace = null) : array;
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/Migrations/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ public function writeSqlFile(string $path, ?string $to = null) : bool
}

/**
* @throws MigrationException
*
* @return string[][]
*
* @throws MigrationException
*/
public function migrate(
?string $to = null,
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/Migrations/MigratorConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
/**
* The MigratorConfiguration class is responsible for defining the configuration for a migration.
*
* @internal
*
* @see Doctrine\Migrations\Migrator
* @see Doctrine\Migrations\Version\Executor
*
* @internal
*/
class MigratorConfiguration
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/Migrations/OutputWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class OutputWriter
public function __construct(?callable $callback = null)
{
if ($callback === null) {
$callback = function ($message) : void {
$callback = static function ($message) : void {
};
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/Migrations/ParameterFormatterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* The ParameterFormatterInterface defines the interface for formatting SQL query parameters to a string
* for display output.
*
* @see Doctrine\Migrations\ParameterFormatter
*
* @internal
*
* @see Doctrine\Migrations\ParameterFormatter
*/
interface ParameterFormatterInterface
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/Migrations/Provider/LazySchemaDiffProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function createFromSchema() : Schema

return $this->proxyFactory->createProxy(
Schema::class,
function (&$wrappedObject, $proxy, $method, array $parameters, &$initializer) use ($originalSchemaManipulator) {
static function (&$wrappedObject, $proxy, $method, array $parameters, &$initializer) use ($originalSchemaManipulator) {
$initializer = null;
$wrappedObject = $originalSchemaManipulator->createFromSchema();

Expand All @@ -64,7 +64,7 @@ public function createToSchema(Schema $fromSchema) : Schema
if ($fromSchema instanceof LazyLoadingInterface && ! $fromSchema->isProxyInitialized()) {
return $this->proxyFactory->createProxy(
Schema::class,
function (& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator, $fromSchema) {
static function (& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator, $fromSchema) {
$initializer = null;
$wrappedObject = $originalSchemaManipulator->createToSchema($fromSchema);

Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/Migrations/Provider/SchemaDiffProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* so that you can manipulate the Schema object. Your manipulated Schema object is then compared to the original Schema
* object to produce the SQL statements that need to be executed.
*
* @see Doctrine\Migrations\Version\Executor
*
* @internal
*
* @see Doctrine\Migrations\Version\Executor
*/
class SchemaDiffProvider implements SchemaDiffProviderInterface
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/Migrations/Rollup.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
* The Rollup class is responsible for deleting all previously executed migrations from the versions table
* and marking the freshly dumped schema migration (that was created with SchemaDumper) as migrated.
*
* @see Doctrine\Migrations\SchemaDumper
*
* @internal
*
* @see Doctrine\Migrations\SchemaDumper
*/
class Rollup
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/Migrations/SchemaDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
* The SchemaDumper class is responsible for dumping the current state of your database schema to a migration. This
* is to be used in conjunction with the Rollup class.
*
* @see Doctrine\Migrations\Rollup
*
* @internal
*
* @see Doctrine\Migrations\Rollup
*/
class SchemaDumper
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/Migrations/Tools/BooleanStringFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
* The BooleanStringFormatter class is responsible for formatting a string boolean representation to a PHP boolean value.
* It is used in the XmlConfiguration class to convert the string XML boolean value to a PHP boolean value.
*
* @see Doctrine\Migrations\Configuration\XmlConfiguration
*
* @internal
*
* @see Doctrine\Migrations\Configuration\XmlConfiguration
*/
class BooleanStringFormatter
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected function getMigrationConfiguration(
$this->migrationConfiguration = $configHelper->getMigrationConfig($input);

$this->migrationConfiguration->getOutputWriter()->setCallback(
function (string $message) use ($output) : void {
static function (string $message) use ($output) : void {
$output->writeln($message);
}
);
Expand Down
5 changes: 2 additions & 3 deletions lib/Doctrine/Migrations/Tools/Console/Command/DiffCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
class DiffCommand extends AbstractCommand
{
/** @var null|SchemaProviderInterface */
/** @var SchemaProviderInterface|null */
protected $schemaProvider;

public function __construct(?SchemaProviderInterface $schemaProvider = null)
Expand Down Expand Up @@ -72,8 +72,7 @@ protected function configure() : void
InputOption::VALUE_OPTIONAL,
'Max line length of unformatted lines.',
120
)
;
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, is this change due to a rule?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep.

}

/**
Expand Down
Loading