Browse files

match doctrine coding standards

  • Loading branch information...
1 parent 6524dd9 commit 1ef9d24ce95f7b715dc5185befad51fc1805d29e Tom Maguire committed Mar 3, 2012
View
14 lib/Doctrine/DBAL/Migrations/Configuration/Configuration.php
@@ -113,7 +113,6 @@ public function __construct(Connection $connection, OutputWriter $outputWriter =
/**
* Validation that this instance has all the required properties configured
*
- * @return void
* @throws MigrationException
*/
public function validate()
@@ -294,7 +293,6 @@ public function registerMigration($version, $class)
*
*
* @param array $migrations
- * @return void
*/
public function registerMigrations(array $migrations)
{
@@ -405,13 +403,12 @@ public function getLatestVersion()
/**
* Create the migration table to track migrations with.
- *
- * @return void
*/
public function createMigrationTable()
{
- if ($this->migrationTableCreated)
+ if ($this->migrationTableCreated) {
return;
+ }
$this->validate();
@@ -465,10 +462,10 @@ public function getMissingMigrations($to)
{
$versions = array();
- foreach($this->migrations as $version)
- {
- if ($this->hasVersionMigrated($version) || $version->getVersion() > $to)
+ foreach($this->migrations as $version) {
+ if ($this->hasVersionMigrated($version) || $version->getVersion() > $to) {
continue;
+ }
$versions[$version->getVersion()] = $version;
}
@@ -483,7 +480,6 @@ public function getMissingMigrations($to)
* @param string $direction The direction we are migrating.
* @param Version $version The Version instance to check.
* @param string $to The version we are migrating to.
- * @return void
*/
private function shouldExecuteMigration($direction, Version $version, $to)
{
View
8 lib/Doctrine/DBAL/Migrations/Tools/Console/Command/PatchCommand.php
@@ -50,7 +50,7 @@ protected function configure()
<info>%command.full_name% YYYYMMDDHHMMSS --write-sql</info>
-Or you can also execute the migration without a warning message wich you need to interact with:
+Or you can also execute the migration without a warning message which you need to interact with:
<info>%command.full_name% --no-interaction</info>
@@ -72,15 +72,15 @@ public function execute(InputInterface $input, OutputInterface $output)
$patch->writeSqlFile($path);
} else {
$dryRun = $input->getOption('dry-run') ? true : false;
- if ($dryRun === true) {
+ if ($dryRun) {
$patch->patch(true);
} else {
$noInteraction = $input->getOption('no-interaction') ? true : false;
- if ($noInteraction === true) {
+ if ($noInteraction) {
$patch->patch($dryRun);
} else {
$confirmation = $this->getHelper('dialog')->askConfirmation($output, '<question>WARNING! You are about to execute a database migration that could result in schema changes and data lost. Are you sure you wish to continue? (y/n)</question>', 'y');
- if ($confirmation === true) {
+ if ($confirmation) {
$patch->patch($dryRun);
} else {
$output->writeln('<error>Patch cancelled!</error>');
View
2 lib/Doctrine/DBAL/Migrations/Version.php
@@ -232,7 +232,9 @@ public function execute($direction, $dryRun = false)
$start = microtime(true);
$this->state = self::STATE_PRE;
+
$fromSchema = $this->sm->createSchema();
+
$this->migration->{'pre' . ucfirst($direction)}($fromSchema);
if ($direction === 'up') {

0 comments on commit 1ef9d24

Please sign in to comment.