Fix #41 #42

Closed
wants to merge 3 commits into
from

Projects

None yet

5 participants

@SongoQ
SongoQ commented Aug 3, 2011

No description provided.

Marcin Chyłek Fix #41 3d916f7
@stof stof and 1 other commented on an outdated diff Aug 3, 2011
...DBAL/Migrations/Tools/Console/Command/DiffCommand.php
@@ -99,8 +99,14 @@ EOT
if (strpos($query, $configuration->getMigrationsTableName()) !== false) {
continue;
}
- $code[] = "\$this->addSql(\"$query\");";
+ $codeSql[] = "\$this->addSql(\"$query\");";
+ }
+
+ if (isset($codeSql)) {
+ return implode("\n", array_merge($code, $codeSql));
stof
stof Aug 3, 2011 Member

the indentation should use 4 spaces

@stof stof and 1 other commented on an outdated diff Aug 3, 2011
...DBAL/Migrations/Tools/Console/Command/DiffCommand.php
@@ -99,8 +99,14 @@ EOT
if (strpos($query, $configuration->getMigrationsTableName()) !== false) {
continue;
}
- $code[] = "\$this->addSql(\"$query\");";
+ $codeSql[] = "\$this->addSql(\"$query\");";
+ }
+
+ if (isset($codeSql)) {
+ return implode("\n", array_merge($code, $codeSql));
+ }
+ else {
stof
stof Aug 3, 2011 Member

the else should be on the same line than the closing curly brace

SongoQ
SongoQ Aug 3, 2011

ok, done. Tnx :)

Marcin Chyłek added some commits Aug 3, 2011
Owner
jwage commented Oct 28, 2011

I prefer this behavior but in your code you changed the variable to $codeSql but don't instantiate that array anywhere.

@jwage jwage commented on the diff Oct 28, 2011
...DBAL/Migrations/Tools/Console/Command/DiffCommand.php
@@ -99,8 +99,13 @@ EOT
if (strpos($query, $configuration->getMigrationsTableName()) !== false) {
continue;
}
- $code[] = "\$this->addSql(\"$query\");";
+ $codeSql[] = "\$this->addSql(\"$query\");";
jwage
jwage Oct 28, 2011 Owner

Where is $codeSql instantiated?

beberlei
beberlei Nov 16, 2011 Owner

Yes please initialize the $codeSQL Variable and check for count() instead of isset()

Ocramius
Ocramius Dec 1, 2011 Owner

I'd check !empty($codeSQL)

Member
stof commented Aug 18, 2014

Fixed in #160

@stof stof closed this Aug 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment