Completed
Pull Request — master (#477)
by
unknown
03:14
created
lib/Doctrine/DBAL/Migrations/Tools/Console/Command/GenerateCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -116,19 +116,19 @@
 block discarded – undo
116 116
         $replacements = [
117 117
             $configuration->getMigrationsNamespace(),
118 118
             $version,
119
-            $up ? "        " . implode("\n        ", explode("\n", $up)) : null,
120
-            $down ? "        " . implode("\n        ", explode("\n", $down)) : null
119
+            $up ? "        ".implode("\n        ", explode("\n", $up)) : null,
120
+            $down ? "        ".implode("\n        ", explode("\n", $down)) : null
121 121
         ];
122 122
         $code = str_replace($placeHolders, $replacements, $this->getTemplate());
123 123
         $code = preg_replace('/^ +$/m', '', $code);
124 124
         $migrationDirectoryHelper = new MigrationDirectoryHelper($configuration);
125 125
         $dir = $migrationDirectoryHelper->getMigrationDirectory();
126
-        $path = $dir . '/Version' . $version . '.php';
126
+        $path = $dir.'/Version'.$version.'.php';
127 127
 
128 128
         file_put_contents($path, $code);
129 129
 
130 130
         if ($editorCmd = $input->getOption('editor-cmd')) {
131
-            proc_open($editorCmd . ' ' . escapeshellarg($path), [], $pipes);
131
+            proc_open($editorCmd.' '.escapeshellarg($path), [], $pipes);
132 132
         }
133 133
 
134 134
         return $path;
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Tools/Console/Command/DiffCommand.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      */
44 44
     protected $schemaProvider;
45 45
 
46
-    public function __construct(SchemaProviderInterface $schemaProvider=null)
46
+    public function __construct(SchemaProviderInterface $schemaProvider = null)
47 47
     {
48 48
         $this->schemaProvider = $schemaProvider;
49 49
         parent::__construct();
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
         $toSchema = $this->getSchemaProvider()->createSchema();
94 94
 
95 95
         //Not using value from options, because filters can be set from config.yml
96
-        if ( ! $isDbalOld && $filterExpr = $conn->getConfiguration()->getFilterSchemaAssetsExpression()) {
96
+        if (!$isDbalOld && $filterExpr = $conn->getConfiguration()->getFilterSchemaAssetsExpression()) {
97 97
             foreach ($toSchema->getTables() as $table) {
98 98
                 $tableName = $table->getName();
99
-                if ( ! preg_match($filterExpr, $this->resolveTableName($tableName))) {
99
+                if (!preg_match($filterExpr, $this->resolveTableName($tableName))) {
100 100
                     $toSchema->dropTable($tableName);
101 101
                 }
102 102
             }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             $input->getOption('line-length')
116 116
         );
117 117
 
118
-        if (! $up && ! $down) {
118
+        if (!$up && !$down) {
119 119
             $output->writeln('No changes detected in your mapping information.', 'ERROR');
120 120
 
121 121
             return;
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         $output->writeln(sprintf('Generated new migration class to "<info>%s</info>" from schema differences.', $path));
128 128
     }
129 129
 
130
-    private function buildCodeFromSql(Configuration $configuration, array $sql, $formatted=false, $lineLength=120)
130
+    private function buildCodeFromSql(Configuration $configuration, array $sql, $formatted = false, $lineLength = 120)
131 131
     {
132 132
         $currentPlatform = $configuration->getConnection()->getDatabasePlatform()->getName();
133 133
         $code = [];
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Configuration/XmlConfiguration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
         libxml_use_internal_errors(true);
40 40
         $xml = new \DOMDocument();
41 41
         $xml->load($file);
42
-        if (!$xml->schemaValidate(__DIR__ . DIRECTORY_SEPARATOR . "XML" . DIRECTORY_SEPARATOR . "configuration.xsd")) {
42
+        if (!$xml->schemaValidate(__DIR__.DIRECTORY_SEPARATOR."XML".DIRECTORY_SEPARATOR."configuration.xsd")) {
43 43
             libxml_clear_errors();
44 44
             throw MigrationException::configurationNotValid('XML configuration did not pass the validation test.');
45 45
         }
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Configuration/AbstractFileConfiguration.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
 
62 62
     protected function setConfiguration(array $config)
63 63
     {
64
-        foreach($config as $configurationKey => $configurationValue) {
64
+        foreach ($config as $configurationKey => $configurationValue) {
65 65
             if (!isset($this->configurationProperties[$configurationKey])) {
66 66
                 $msg = sprintf('Migrations configuration key "%s" does not exists.', $configurationKey);
67 67
                 throw MigrationException::configurationNotValid($msg);
68 68
             }
69 69
         }
70
-        foreach($this->configurationProperties as $configurationKey => $configurationSetter) {
70
+        foreach ($this->configurationProperties as $configurationKey => $configurationSetter) {
71 71
             if (isset($config[$configurationKey])) {
72 72
                 $this->{$configurationSetter}($config[$configurationKey]);
73 73
             }
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         } else if (strcasecmp($migrationOrganisation, static::VERSIONS_ORGANIZATION_BY_YEAR_AND_MONTH) == 0) {
97 97
             $this->setMigrationsAreOrganizedByYearAndMonth();
98 98
         } else {
99
-            $msg = 'Unknown ' . var_export($migrationOrganisation, true) . ' for configuration "organize_migrations".';
99
+            $msg = 'Unknown '.var_export($migrationOrganisation, true).' for configuration "organize_migrations".';
100 100
             throw MigrationException::configurationNotValid($msg);
101 101
         }
102 102
     }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         if ($this->loaded) {
114 114
             throw MigrationException::configurationFileAlreadyLoaded();
115 115
         }
116
-        if (file_exists($path = getcwd() . '/' . $file)) {
116
+        if (file_exists($path = getcwd().'/'.$file)) {
117 117
             $file = $path;
118 118
         }
119 119
         $this->file = $file;
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
     protected function getDirectoryRelativeToFile($file, $input)
130 130
     {
131
-        $path = realpath(dirname($file) . '/' . $input);
131
+        $path = realpath(dirname($file).'/'.$input);
132 132
 
133 133
         return ($path !== false) ? $path : $input;
134 134
     }
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/MigrationsVersion.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,6 +40,6 @@
 block discarded – undo
40 40
      * in a modified (not tagged) phar version.
41 41
      */
42 42
     private static function isACustomPharBuild($gitversion) {
43
-        return $gitversion !== '@' . 'git-version@';
43
+        return $gitversion !== '@'.'git-version@';
44 44
     }
45 45
 }
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Finder/AbstractFinder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             $version = (string) substr($className, 7);
63 63
             if ($version === '0') {
64 64
                 throw new \InvalidArgumentException(sprintf(
65
-                    'Cannot load a migrations with the name "%s" because it is a reserved number by doctrine migraitons' . PHP_EOL .
65
+                    'Cannot load a migrations with the name "%s" because it is a reserved number by doctrine migraitons'.PHP_EOL.
66 66
                     'It\'s used to revert all migrations including the first one.',
67 67
                     $version
68 68
                 ));
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
      *
79 79
      * @return callable
80 80
      */
81
-    protected function getFileSortCallback(){
82
-        return function ($a, $b) {
81
+    protected function getFileSortCallback() {
82
+        return function($a, $b) {
83 83
             return (basename($a) < basename($b)) ? -1 : 1;
84 84
         };
85 85
     }
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Finder/GlobFinder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     {
39 39
         $dir = $this->getRealPath($directory);
40 40
 
41
-        $files = glob(rtrim($dir, '/') . '/Version*.php');
41
+        $files = glob(rtrim($dir, '/').'/Version*.php');
42 42
 
43 43
         return $this->loadMigrations($files, $namespace);
44 44
     }
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Configuration/Configuration.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
         $this->createMigrationTable();
494 494
 
495 495
         $version = $this->connection->fetchColumn(
496
-            "SELECT " . $this->migrationsColumnName . " FROM " . $this->migrationsTableName . " WHERE " . $this->migrationsColumnName . " = ?",
496
+            "SELECT ".$this->migrationsColumnName." FROM ".$this->migrationsTableName." WHERE ".$this->migrationsColumnName." = ?",
497 497
             [$version->getVersion()]
498 498
         );
499 499
 
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
     {
510 510
         $this->createMigrationTable();
511 511
 
512
-        $ret = $this->connection->fetchAll("SELECT " . $this->migrationsColumnName . " FROM " . $this->migrationsTableName);
512
+        $ret = $this->connection->fetchAll("SELECT ".$this->migrationsColumnName." FROM ".$this->migrationsTableName);
513 513
 
514 514
         return array_map('current', $ret);
515 515
     }
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
             foreach ($this->migrations as $migration) {
554 554
                 $migratedVersions[] = sprintf("'%s'", $migration->getVersion());
555 555
             }
556
-            $where = " WHERE " . $this->migrationsColumnName . " IN (" . implode(', ', $migratedVersions) . ")";
556
+            $where = " WHERE ".$this->migrationsColumnName." IN (".implode(', ', $migratedVersions).")";
557 557
         }
558 558
 
559 559
         $sql = sprintf("SELECT %s FROM %s%s ORDER BY %s DESC",
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
 
604 604
         $versions = array_map('strval', array_keys($this->migrations));
605 605
         array_unshift($versions, '0');
606
-        $offset = array_search((string)$version, $versions);
606
+        $offset = array_search((string) $version, $versions);
607 607
         if ($offset === false || !isset($versions[$offset + $delta])) {
608 608
             // Unknown version or delta out of bounds.
609 609
             return null;
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
     {
660 660
         $this->createMigrationTable();
661 661
 
662
-        $result = $this->connection->fetchColumn("SELECT COUNT(" . $this->migrationsColumnName . ") FROM " . $this->migrationsTableName);
662
+        $result = $this->connection->fetchColumn("SELECT COUNT(".$this->migrationsColumnName.") FROM ".$this->migrationsTableName);
663 663
 
664 664
         return $result !== false ? $result : 0;
665 665
     }
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
      */
846 846
     private function ensureMigrationClassExists($class)
847 847
     {
848
-        if ( ! class_exists($class)) {
848
+        if (!class_exists($class)) {
849 849
             throw MigrationException::migrationClassNotFound($class, $this->getMigrationsNamespace());
850 850
         }
851 851
     }
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/SqlFileWriter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         $string = $this->buildMigrationFile($queriesByVersion, $direction);
70 70
 
71 71
         if ($this->outputWriter) {
72
-            $this->outputWriter->write("\n" . sprintf('Writing migration file to "<info>%s</info>"', $path));
72
+            $this->outputWriter->write("\n".sprintf('Writing migration file to "<info>%s</info>"', $path));
73 73
         }
74 74
 
75 75
         return file_put_contents($path, $string);
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
         $string = sprintf("-- Doctrine Migration File Generated on %s\n", date('Y-m-d H:i:s'));
81 81
 
82 82
         foreach ($queriesByVersion as $version => $queries) {
83
-            $string .= "\n-- Version " . $version . "\n";
83
+            $string .= "\n-- Version ".$version."\n";
84 84
             foreach ($queries as $query) {
85
-                $string .= $query . ";\n";
85
+                $string .= $query.";\n";
86 86
             }
87 87
 
88 88
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     {
108 108
         $path = $this->destPath;
109 109
         if (is_dir($path)) {
110
-            $path = $path . '/doctrine_migration_' . date('YmdHis') . '.sql';
110
+            $path = $path.'/doctrine_migration_'.date('YmdHis').'.sql';
111 111
         }
112 112
 
113 113
         return $path;
Please login to merge, or discard this patch.