Failed Conditions
Pull Request — master (#589)
by
unknown
04:58
created
lib/Doctrine/DBAL/Migrations/Tools/Console/Helper/ConfigurationHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
          * instead of any other one.
61 61
          */
62 62
         if ($input->getOption('configuration')) {
63
-            $outputWriter->write("Loading configuration from command option: " . $input->getOption('configuration'));
63
+            $outputWriter->write("Loading configuration from command option: ".$input->getOption('configuration'));
64 64
 
65 65
             return $this->loadConfig($input->getOption('configuration'), $outputWriter);
66 66
         }
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/SqlFileWriter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         $string = $this->buildMigrationFile($queriesByVersion, $direction);
79 79
 
80 80
         if ($this->outputWriter) {
81
-            $this->outputWriter->write("\n" . sprintf('Writing migration file to "<info>%s</info>"', $path));
81
+            $this->outputWriter->write("\n".sprintf('Writing migration file to "<info>%s</info>"', $path));
82 82
         }
83 83
 
84 84
         return file_put_contents($path, $string);
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
         $string = sprintf("-- Doctrine Migration File Generated on %s\n", date('Y-m-d H:i:s'));
90 90
 
91 91
         foreach ($queriesByVersion as $version => $queries) {
92
-            $string .= "\n-- Version " . $version . "\n";
92
+            $string .= "\n-- Version ".$version."\n";
93 93
 
94 94
             foreach ($queries as $query) {
95
-                $string .= $query . ";\n";
95
+                $string .= $query.";\n";
96 96
             }
97 97
 
98 98
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
         if (is_dir($path)) {
121 121
             $path = realpath($path);
122
-            $path = $path . '/doctrine_migration_' . date('YmdHis') . '.sql';
122
+            $path = $path.'/doctrine_migration_'.date('YmdHis').'.sql';
123 123
         }
124 124
 
125 125
         return $path;
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
@@ -42,6 +42,6 @@
 block discarded – undo
42 42
      */
43 43
     private static function isACustomPharBuild($gitversion)
44 44
     {
45
-        return $gitversion !== '@' . 'git-version@';
45
+        return $gitversion !== '@'.'git-version@';
46 46
     }
47 47
 }
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Provider/OrmSchemaProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 
38 38
     public function __construct($em)
39 39
     {
40
-        if ( ! $this->isEntityManager($em)) {
40
+        if (!$this->isEntityManager($em)) {
41 41
             throw new \InvalidArgumentException(sprintf(
42 42
                 '$em is not a valid Doctrine ORM Entity Manager, got "%s"',
43 43
                 is_object($em) ? get_class($em) : gettype($em)
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Provider/LazySchemaDiffProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
         return $this->proxyFactory->createProxy(
72 72
             Schema::class,
73
-            function (& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator) {
73
+            function(& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator) {
74 74
                 $initializer   = null;
75 75
                 $wrappedObject = $originalSchemaManipulator->createFromSchema();
76 76
 
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
     {
88 88
         $originalSchemaManipulator = $this->originalSchemaManipulator;
89 89
 
90
-        if ($fromSchema instanceof LazyLoadingInterface && ! $fromSchema->isProxyInitialized()) {
90
+        if ($fromSchema instanceof LazyLoadingInterface && !$fromSchema->isProxyInitialized()) {
91 91
             return $this->proxyFactory->createProxy(
92 92
                 Schema::class,
93
-                function (& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator, $fromSchema) {
93
+                function(& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator, $fromSchema) {
94 94
                     $initializer   = null;
95 95
                     $wrappedObject = $originalSchemaManipulator->createToSchema($fromSchema);
96 96
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     public function getSqlDiffToMigrate(Schema $fromSchema, Schema $toSchema)
112 112
     {
113 113
         if ($toSchema instanceof LazyLoadingInterface
114
-            && ! $toSchema->isProxyInitialized()) {
114
+            && !$toSchema->isProxyInitialized()) {
115 115
             return [];
116 116
         }
117 117
 
Please login to merge, or discard this patch.
Doctrine/DBAL/Migrations/Tools/Console/Helper/MigrationDirectoryHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         $dir = $dir ? $dir : getcwd();
47 47
         $dir = rtrim($dir, '/');
48 48
 
49
-        if ( ! file_exists($dir)) {
49
+        if (!file_exists($dir)) {
50 50
             throw new \InvalidArgumentException(sprintf('Migrations directory "%s" does not exist.', $dir));
51 51
         }
52 52
 
@@ -64,12 +64,12 @@  discard block
 block discarded – undo
64 64
 
65 65
     private function appendDir($dir)
66 66
     {
67
-        return DIRECTORY_SEPARATOR . $dir;
67
+        return DIRECTORY_SEPARATOR.$dir;
68 68
     }
69 69
 
70 70
     private function createDirIfNotExists($dir)
71 71
     {
72
-        if ( ! file_exists($dir)) {
72
+        if (!file_exists($dir)) {
73 73
             mkdir($dir, 0755, true);
74 74
         }
75 75
     }
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Tools/Console/Command/DiffCommand.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -93,16 +93,16 @@  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
             }
103 103
         }
104 104
 
105
-        $up   = $this->buildCodeFromSql(
105
+        $up = $this->buildCodeFromSql(
106 106
             $configuration,
107 107
             $fromSchema->getMigrateToSql($toSchema, $platform),
108 108
             $input->getOption('formatted'),
@@ -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.');
120 120
 
121 121
             return;
@@ -138,9 +138,9 @@  discard block
 block discarded – undo
138 138
             }
139 139
 
140 140
             if ($formatted) {
141
-                if ( ! class_exists('\SqlFormatter')) {
141
+                if (!class_exists('\SqlFormatter')) {
142 142
                     throw new \InvalidArgumentException(
143
-                        'The "--formatted" option can only be used if the sql formatter is installed.' .
143
+                        'The "--formatted" option can only be used if the sql formatter is installed.'.
144 144
                         'Please run "composer require jdorn/sql-formatter".'
145 145
                     );
146 146
                 }
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
             $code[] = sprintf("\$this->addSql(%s);", var_export($query, true));
156 156
         }
157 157
 
158
-        if ( ! empty($code)) {
158
+        if (!empty($code)) {
159 159
             array_unshift(
160 160
                 $code,
161 161
                 sprintf(
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 
173 173
     private function getSchemaProvider()
174 174
     {
175
-        if ( ! $this->schemaProvider) {
175
+        if (!$this->schemaProvider) {
176 176
             $this->schemaProvider = new OrmSchemaProvider($this->getHelper('entityManager')->getEntityManager());
177 177
         }
178 178
 
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Tools/Console/Command/MigrateCommand.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         }
105 105
 
106 106
         $executedUnavailableMigrations = array_diff($executedMigrations, $availableMigrations);
107
-        if ( ! empty($executedUnavailableMigrations)) {
107
+        if (!empty($executedUnavailableMigrations)) {
108 108
             $output->writeln(sprintf(
109 109
                 '<error>WARNING! You have %s previously executed migrations'
110 110
                 . ' in the database that are not registered migrations.</error>',
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             }
121 121
 
122 122
             $question = 'Are you sure you wish to continue? (y/n)';
123
-            if ( ! $this->canExecute($question, $input, $output)) {
123
+            if (!$this->canExecute($question, $input, $output)) {
124 124
                 $output->writeln('<error>Migration cancelled!</error>');
125 125
 
126 126
                 return 1;
@@ -137,12 +137,12 @@  discard block
 block discarded – undo
137 137
 
138 138
         $cancelled = false;
139 139
         $migration->setNoMigrationException($input->getOption('allow-no-migration'));
140
-        $result = $migration->migrate($version, $dryRun, $timeAllqueries, function () use ($input, $output, &$cancelled) {
140
+        $result = $migration->migrate($version, $dryRun, $timeAllqueries, function() use ($input, $output, &$cancelled) {
141 141
             $question    = 'WARNING! You are about to execute a database migration'
142 142
                 . ' that could result in schema changes and data lost.'
143 143
                 . ' Are you sure you wish to continue? (y/n)';
144 144
             $canContinue = $this->canExecute($question, $input, $output);
145
-            $cancelled   = ! $canContinue;
145
+            $cancelled   = !$canContinue;
146 146
 
147 147
             return $canContinue;
148 148
         });
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
      */
173 173
     private function canExecute($question, InputInterface $input, OutputInterface $output)
174 174
     {
175
-        if ($input->isInteractive() && ! $this->askConfirmation($question, $input, $output)) {
175
+        if ($input->isInteractive() && !$this->askConfirmation($question, $input, $output)) {
176 176
             return false;
177 177
         }
178 178
 
Please login to merge, or discard this patch.