Completed
Pull Request — master (#426)
by Reen
09:08
created
lib/Doctrine/DBAL/Migrations/Finder/AbstractFinder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,8 +78,8 @@
 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/Tools/Console/Command/DiffCommand.php 1 patch
Spacing   +4 added lines, -4 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();
@@ -90,10 +90,10 @@  discard block
 block discarded – undo
90 90
         $toSchema = $this->getSchemaProvider()->createSchema();
91 91
 
92 92
         //Not using value from options, because filters can be set from config.yml
93
-        if ( ! $isDbalOld && $filterExpr = $conn->getConfiguration()->getFilterSchemaAssetsExpression()) {
93
+        if (!$isDbalOld && $filterExpr = $conn->getConfiguration()->getFilterSchemaAssetsExpression()) {
94 94
             foreach ($toSchema->getTables() as $table) {
95 95
                 $tableName = $table->getName();
96
-                if ( ! preg_match($filterExpr, $this->resolveTableName($tableName))) {
96
+                if (!preg_match($filterExpr, $this->resolveTableName($tableName))) {
97 97
                     $toSchema->dropTable($tableName);
98 98
                 }
99 99
             }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         $up = $this->buildCodeFromSql($configuration, $fromSchema->getMigrateToSql($toSchema, $platform));
103 103
         $down = $this->buildCodeFromSql($configuration, $fromSchema->getMigrateFromSql($toSchema, $platform));
104 104
 
105
-        if (! $up && ! $down) {
105
+        if (!$up && !$down) {
106 106
             $output->writeln('No changes detected in your mapping information.', 'ERROR');
107 107
 
108 108
             return;
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Tools/Console/Command/MigrateCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
             }
115 115
 
116 116
             $question = 'Are you sure you wish to continue? (y/n)';
117
-            if (! $this->canExecute($question, $input, $output)) {
117
+            if (!$this->canExecute($question, $input, $output)) {
118 118
                 $output->writeln('<error>Migration cancelled!</error>');
119 119
 
120 120
                 return 1;
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
             $dryRun = (boolean) $input->getOption('dry-run');
129 129
 
130 130
             // warn the user if no dry run and interaction is on
131
-            if (! $dryRun) {
131
+            if (!$dryRun) {
132 132
                 $question = 'WARNING! You are about to execute a database migration'
133 133
                     . ' that could result in schema changes and data lost.'
134 134
                     . ' Are you sure you wish to continue? (y/n)';
135
-                if (! $this->canExecute($question, $input, $output)) {
135
+                if (!$this->canExecute($question, $input, $output)) {
136 136
                     $output->writeln('<error>Migration cancelled!</error>');
137 137
 
138 138
                     return 1;
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
      */
157 157
     private function canExecute($question, InputInterface $input, OutputInterface $output)
158 158
     {
159
-        if ($input->isInteractive() && ! $this->askConfirmation($question, $input, $output)) {
159
+        if ($input->isInteractive() && !$this->askConfirmation($question, $input, $output)) {
160 160
             return false;
161 161
         }
162 162
 
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Configuration/AbstractFileConfiguration.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
 
61 61
     protected function setConfiguration(Array $config)
62 62
     {
63
-        foreach($config as $configurationKey => $configurationValue) {
63
+        foreach ($config as $configurationKey => $configurationValue) {
64 64
             if (!isset($this->configurationProperties[$configurationKey])) {
65 65
                 $msg = sprintf('Migrations configuration key "%s" does not exists.', $configurationKey);
66 66
                 throw MigrationException::configurationNotValid($msg);
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Configuration/Configuration.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -787,7 +787,7 @@
 block discarded – undo
787 787
      */
788 788
     private function ensureMigrationClassExists($class)
789 789
     {
790
-        if ( ! class_exists($class)) {
790
+        if (!class_exists($class)) {
791 791
             throw MigrationException::migrationClassNotFound($class, $this->getMigrationsNamespace());
792 792
         }
793 793
     }
Please login to merge, or discard this patch.
Doc Comments   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
      * the value is the migration class name.
420 420
      *
421 421
      *
422
-     * @param array $migrations
422
+     * @param string[] $migrations
423 423
      *
424 424
      * @return Version[]
425 425
      */
@@ -587,6 +587,8 @@  discard block
 block discarded – undo
587 587
     /**
588 588
      * Returns the version with the specified offset to the specified version.
589 589
      *
590
+     * @param string $version
591
+     * @param integer $delta
590 592
      * @return string|null A version string, or null if the specified version
591 593
      *                     is unknown or the specified delta is not within the
592 594
      *                     list of available versions.
@@ -763,7 +765,7 @@  discard block
 block discarded – undo
763 765
      * Find all the migrations in a given directory.
764 766
      *
765 767
      * @param   string $path the directory to search.
766
-     * @return  array
768
+     * @return  string[]
767 769
      */
768 770
     protected function findMigrations($path)
769 771
     {
@@ -813,9 +815,9 @@  discard block
 block discarded – undo
813 815
      * @param string  $direction The direction we are migrating.
814 816
      * @param Version $version   The Version instance to check.
815 817
      * @param string  $to        The version we are migrating to.
816
-     * @param array   $migrated  Migrated versions array.
818
+     * @param Version[]   $migrated  Migrated versions array.
817 819
      *
818
-     * @return boolean
820
+     * @return boolean|null
819 821
      */
820 822
     private function shouldExecuteMigration($direction, Version $version, $to, $migrated)
821 823
     {
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Provider/LazySchemaDiffProvider.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
     }
40 40
 
41 41
     /**
42
-     * @return Schema
42
+     * @return \ProxyManager\Proxy\VirtualProxyInterface
43 43
      */
44 44
     public function createFromSchema()
45 45
     {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
         return $this->proxyFactory->createProxy(
49 49
             Schema::class,
50
-            function (& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator) {
50
+            function(& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator) {
51 51
                 $initializer   = null;
52 52
                 $wrappedObject = $originalSchemaManipulator->createFromSchema();
53 53
 
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
     {
65 65
         $originalSchemaManipulator = $this->originalSchemaManipulator;
66 66
 
67
-        if ($fromSchema instanceof LazyLoadingInterface && ! $fromSchema->isProxyInitialized()) {
67
+        if ($fromSchema instanceof LazyLoadingInterface && !$fromSchema->isProxyInitialized()) {
68 68
             return $this->proxyFactory->createProxy(
69 69
                 Schema::class,
70
-                function (& $wrappedObject, $proxy,  $method, array $parameters, & $initializer) use ($originalSchemaManipulator, $fromSchema) {
70
+                function(& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator, $fromSchema) {
71 71
                     $initializer   = null;
72 72
                     $wrappedObject = $originalSchemaManipulator->createToSchema($fromSchema);
73 73
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     {
90 90
         if (
91 91
             $toSchema instanceof LazyLoadingInterface
92
-            && ! $toSchema->isProxyInitialized()
92
+            && !$toSchema->isProxyInitialized()
93 93
         ) {
94 94
             return [];
95 95
         }
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Tools/Console/Command/StatusCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
             if ($name == 'New Migrations') {
68 68
                 $value = $value > 0 ? '<question>' . $value . '</question>' : 0;
69 69
             }
70
-            if($name == 'Executed Unavailable Migrations') {
70
+            if ($name == 'Executed Unavailable Migrations') {
71 71
                 $value = $value > 0 ? '<error>' . $value . '</error>' : 0;
72 72
             }
73 73
             $this->writeStatusInfosLineAligned($output, $name, $value);
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     {
100 100
         $migratedVersions = $configuration->getMigratedVersions();
101 101
 
102
-        foreach($migrations as $version) {
102
+        foreach ($migrations as $version) {
103 103
             $isMigrated = in_array($version->getVersion(), $migratedVersions);
104 104
             $status = $isMigrated ? '<info>migrated</info>' : '<error>not migrated</error>';
105 105
             $migrationDescription = '';
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
 
111 111
             $output->writeln('    <comment>>></comment> ' . $formattedVersion .
112 112
                 ' (<comment>' . $version->getVersion() . '</comment>)' .
113
-                str_repeat(' ', 49 - strlen($formattedVersion) - strlen($version->getVersion()))  .
114
-                $status  . $migrationDescription);
113
+                str_repeat(' ', 49 - strlen($formattedVersion) - strlen($version->getVersion())) .
114
+                $status . $migrationDescription);
115 115
         }
116 116
     }
117 117
 }
Please login to merge, or discard this patch.
Configuration/Connection/Loader/ConnectionConfigurationChainLoader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 
34 34
     public function load()
35 35
     {
36
-        foreach($this->loaders as $loader) {
36
+        foreach ($this->loaders as $loader) {
37 37
             if (false !== $confObj = $loader->load()) {
38 38
                 return $confObj;
39 39
             }
Please login to merge, or discard this patch.
Configuration/Connection/Loader/ConnectionConfigurationLoader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     /** @var Configuration */
31 31
     private $configuration;
32 32
 
33
-    public function __construct(Configuration $configuration=null)
33
+    public function __construct(Configuration $configuration = null)
34 34
     {
35 35
         if ($configuration !== null) {
36 36
             $this->configuration = $configuration;
Please login to merge, or discard this patch.