Completed
Branch 1.1 (856e37)
by Stefan
09:05
created
src/Codengine/CustomMigrations/BatchMigrationTrait.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 	 * Filters the connections and only returns the ones that match the migration type
33 33
 	 *
34 34
 	 * @param array $connection The database connections
35
-	 * @return bool Returns TRUE on a match, else FALSE
35
+	 * @return boolean|null Returns TRUE on a match, else FALSE
36 36
 	 */
37 37
 	protected function filterConnections($connection)
38 38
 	{
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	 */
37 37
 	protected function filterConnections($connection)
38 38
 	{
39
-		switch($this->migrationType)
39
+		switch ($this->migrationType)
40 40
 		{
41 41
 			case 'default':
42 42
 				return (empty($connection['migration_type']) || $connection['migration_type'] == 'default'); break;
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	protected function getDefaultConnection()
54 54
 	{
55 55
 		$defaultConnection = \DB::getDefaultConnection();
56
-		$connection = \Config::get('database.connections.' . $defaultConnection);
56
+		$connection = \Config::get('database.connections.'.$defaultConnection);
57 57
 		return (empty($connection) ? array() : array($defaultConnection => $connection));
58 58
 	}
59 59
 
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
 	protected function getConnectionsByType($filter = null)
67 67
 	{
68 68
 		$connections = array();
69
-		if($this->migrationType == "default" && empty($filter)) {
69
+		if ($this->migrationType == "default" && empty($filter)) {
70 70
 			return $this->getDefaultConnection();
71 71
 		} elseif (!empty($filter)) {
72
-			$connections = \Config::get('database.connections.' . $filter);
73
-			if(!empty($connections))
72
+			$connections = \Config::get('database.connections.'.$filter);
73
+			if (!empty($connections))
74 74
 			{
75 75
 				$connections = array($filter => $connections);
76 76
 			}
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 			$connections = \Config::get('database.connections');
79 79
 		}
80 80
 
81
-		if(!empty($connections))
81
+		if (!empty($connections))
82 82
 		{
83 83
 			$connections = array_filter($connections, array($this, 'filterConnections'));
84 84
 		}
@@ -100,10 +100,10 @@  discard block
 block discarded – undo
100 100
 	 */
101 101
 	protected function runMigrationsOnConnections($connections)
102 102
 	{
103
-		foreach($connections as $name => $connection)
103
+		foreach ($connections as $name => $connection)
104 104
 		{
105 105
 			$this->input->setOption('database', $name);
106
-			if(isset($this->migrator))
106
+			if (isset($this->migrator))
107 107
 			{
108 108
 				$this->migrator->setMigrationType(array_get($connection, 'migration_type', 'default'));
109 109
 			}
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	{
119 119
 		$this->setMigrationType();
120 120
 		$connections = $this->getConnectionsByType($this->input->getOption('database'));
121
-		if(empty($connections))
121
+		if (empty($connections))
122 122
 		{
123 123
 			$this->info("No connections found for the specified migration type");
124 124
 		} else {
Please login to merge, or discard this patch.
src/Codengine/CustomMigrations/CustomMigrationsServiceProvider.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use Codengine\CustomMigrations\Commands\ResetCommand;
6 6
 use Codengine\CustomMigrations\Commands\RollbackCommand;
7 7
 use Illuminate\Database\MigrationServiceProvider;
8
-use Illuminate\Support\ServiceProvider;
9 8
 
10 9
 class CustomMigrationsServiceProvider extends MigrationServiceProvider {
11 10
 	/**
Please login to merge, or discard this patch.
src/Codengine/CustomMigrations/Commands/RefreshCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 
8 8
 	public function call($command, array $arguments = array())
9 9
 	{
10
-		if($command === 'migrate' || $command === 'migrate:reset')
10
+		if ($command === 'migrate' || $command === 'migrate:reset')
11 11
 		{
12 12
 			$arguments['--type'] = $this->input->getOption('type');
13 13
 
Please login to merge, or discard this patch.
src/Codengine/CustomMigrations/Migrator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
 	protected function filterMigrations($migration)
42 42
 	{
43 43
 		$instance = $this->resolve($migration);
44
-		if(empty($instance->type))
44
+		if (empty($instance->type))
45 45
 		{
46 46
 			$instance->type = 'default';
47 47
 		}
48 48
 
49
-		if($this->migrationType != $instance->type)
49
+		if ($this->migrationType != $instance->type)
50 50
 		{
51 51
 			return false;
52 52
 		} else {
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function runMigrationList($migrations, $pretend = FALSE)
64 64
 	{
65
-		$this->note("Running " . ($this->migrationType == "default" ? "default" : "custom") . " migrations for DB " . $this->connection);
65
+		$this->note("Running ".($this->migrationType == "default" ? "default" : "custom")." migrations for DB ".$this->connection);
66 66
 		$migrations = array_filter($migrations, array($this, "filterMigrations"));
67 67
 		parent::runMigrationList($migrations, $pretend);
68 68
 	}
Please login to merge, or discard this patch.