Skip to content

Commit 9624df5

Browse files
author
Alexandre Guidet
committed
Merge branch 'hotfix-3.6.5'
2 parents 5c3dea2 + fa70c53 commit 9624df5

12 files changed

Lines changed: 11 additions & 25 deletions

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
nbproject
21
environments
32
clean.sh
43
.project

Migrate/Command/AbstractComand.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
namespace Migrate\Command;
99

1010
use Symfony\Component\Console\Command\Command;
11-
use Symfony\Component\Console\Input\InputArgument;
12-
use Symfony\Component\Console\Input\InputInterface;
13-
use Symfony\Component\Console\Input\InputOption;
14-
use Symfony\Component\Console\Output\OutputInterface;
1511

1612

1713
class AbstractComand extends Command {

Migrate/Command/AbstractEnvCommand.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected function init(InputInterface $input, OutputInterface $output, $env = n
6464
$configDirectory = array(getcwd() . '/.php-database-migration/environments');
6565
$locator = new FileLocator($configDirectory);
6666

67-
if ($env == null) {
67+
if ($env === null) {
6868
$env = $input->getArgument('env');
6969
}
7070

@@ -86,9 +86,9 @@ protected function init(InputInterface $input, OutputInterface $output, $env = n
8686
if ($driver == 'sqlite') {
8787
$uri .= ":$dbname";
8888
} else {
89-
$uri .= ($dbname == null) ? '' : ":dbname=$dbname";
90-
$uri .= ($host == null) ? '' : ";host=$host";
91-
$uri .= ($port == null) ? '' : ";port=$port";
89+
$uri .= ($dbname === null) ? '' : ":dbname=$dbname";
90+
$uri .= ($host === null) ? '' : ";host=$host";
91+
$uri .= ($port === null) ? '' : ";port=$port";
9292
}
9393
$this->db = new \PDO(
9494
$uri,
@@ -170,7 +170,6 @@ public function getToUpMigrations()
170170

171171
public function getToDownMigrations()
172172
{
173-
$locales = $this->getLocalMigrations();
174173
$remotes = $this->getRemoteMigrations();
175174

176175
ksort($remotes);
@@ -272,7 +271,7 @@ protected function filterMigrationsToExecute(InputInterface $input, OutputInterf
272271
}
273272

274273
$only = $input->getOption('only');
275-
if ($only != null) {
274+
if ($only !== null) {
276275
if (! array_key_exists($only, $toExecute)) {
277276
throw new \RuntimeException("Impossible to execute migration $only!");
278277
}
@@ -281,7 +280,7 @@ protected function filterMigrationsToExecute(InputInterface $input, OutputInterf
281280
}
282281

283282
$to = $input->getOption('to');
284-
if ($to != null) {
283+
if ($to !== null) {
285284
if (! array_key_exists($to, $toExecute)) {
286285
throw new \RuntimeException("Target migration $to does not exists or has already been executed/downed!");
287286
}

Migrate/Command/AddEnvCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7575
$defaultEditorQuestion = new Question("Please enter the text editor to use by default <info>(default vim)</info>: ", "vim");
7676
$defaultEditor = $questions->ask($input, $output, $defaultEditorQuestion);
7777

78-
$confTemplate = file_get_contents(__DIR__ . '/../../templates/env.yml');
78+
$confTemplate = file_get_contents(__DIR__ . '/../../templates/env.yml.tpl');
7979
$confTemplate = str_replace('{DRIVER}', $driver, $confTemplate);
8080
$confTemplate = str_replace('{HOST}', $dbHost, $confTemplate);
8181
$confTemplate = str_replace('{PORT}', $dbPort, $confTemplate);

Migrate/Command/CreateCommand.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@
88
namespace Migrate\Command;
99

1010
use Cocur\Slugify\Slugify;
11-
use Symfony\Component\Console\Command\Command;
1211
use Symfony\Component\Console\Helper\QuestionHelper;
13-
use Symfony\Component\Console\Input\InputArgument;
1412
use Symfony\Component\Console\Input\InputInterface;
15-
use Symfony\Component\Console\Input\InputOption;
1613
use Symfony\Component\Console\Output\OutputInterface;
1714
use Symfony\Component\Console\Question\Question;
1815

@@ -37,7 +34,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
3734
$description = $questions->ask($input, $output, $descriptionQuestion);
3835

3936
$editorQuestion = new Question("Please chose which editor to use <info>(default vim)</info>: ", "vim");
40-
$editor = $questions->ask($input, $output, $editorQuestion);
37+
$questions->ask($input, $output, $editorQuestion);
4138

4239
$slugger = new Slugify();
4340
$filename = $slugger->slugify($description);

Migrate/Command/DownCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
namespace Migrate\Command;
99

1010

11-
use Symfony\Component\Console\Command\Command;
1211
use Symfony\Component\Console\Helper\ProgressBar;
1312
use Symfony\Component\Console\Helper\QuestionHelper;
1413
use Symfony\Component\Console\Input\InputArgument;

Migrate/Command/InitCommand.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@
77

88
namespace Migrate\Command;
99

10-
use Migrate\Utils\ArrayUtil;
11-
use Symfony\Component\Console\Command\Command;
1210
use Symfony\Component\Console\Input\InputArgument;
1311
use Symfony\Component\Console\Input\InputInterface;
14-
use Symfony\Component\Console\Input\InputOption;
1512
use Symfony\Component\Console\Output\OutputInterface;
1613

1714
class InitCommand extends AbstractEnvCommand {

Migrate/Command/StatusCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
use Migrate\Migration;
13-
use Migrate\Utils\ArrayUtil;
1413
use Symfony\Component\Console\Helper\Table;
1514
use Symfony\Component\Console\Input\InputArgument;
1615
use Symfony\Component\Console\Input\InputInterface;

Migrate/Command/UpCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
namespace Migrate\Command;
99

10-
use Symfony\Component\Console\Command\Command;
1110
use Symfony\Component\Console\Helper\ProgressBar;
1211
use Symfony\Component\Console\Input\InputArgument;
1312
use Symfony\Component\Console\Input\InputInterface;

Migrate/Migration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function toArray()
177177

178178
public function load($migrationDir)
179179
{
180-
@$content = file_get_contents($migrationDir . '/' . $this->getFile());
180+
$content = file_get_contents($migrationDir . '/' . $this->getFile());
181181
if ($content && strpos($content, '@UNDO') > 0) {
182182
$sql = explode('-- @UNDO', $content);
183183
$this->setSqlUp($sql[0]);

0 commit comments

Comments
 (0)