diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..81344c9 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,19 @@ + + + Project PHP Code Style Rules + + src + tests + + + + + + + */.git/* + */vendor/* + + + diff --git a/src/Commands/Gozer.php b/src/Commands/Gozer.php index 0a1f3cb..f551a6f 100644 --- a/src/Commands/Gozer.php +++ b/src/Commands/Gozer.php @@ -135,14 +135,12 @@ class Gozer extends Command { try { /** @var \Doctrine\DBAL\Schema\AbstractSchemaManager $connection */ - $connection = app('db')->connection()->getDoctrineSchemaManager(); + return app('db')->connection()->getDoctrineSchemaManager(); } catch (\Exception $e) { $this->error($e->getMessage()); return false; } - - return $connection; } /** @@ -180,7 +178,7 @@ class Gozer extends Command } /** - * @param array $tables + * @param array|\Illuminate\Support\Collection $tables * * @return \Illuminate\Support\Collection */ diff --git a/src/Facade.php b/src/Facade.php index e593f94..09b3c26 100644 --- a/src/Facade.php +++ b/src/Facade.php @@ -1,4 +1,5 @@ app->singleton('command.superhelio.reload', function ($app) { - return $app[ \Superhelio\Commands\Commands\Reload::class ]; + return $app[\Superhelio\Commands\Commands\Reload::class]; }); $this->commands('command.superhelio.reload'); } @@ -44,7 +44,7 @@ class ServiceProvider extends BaseServiceProvider private function registerGozer() { $this->app->singleton('command.superhelio.gozer', function ($app) { - return $app[ \Superhelio\Commands\Commands\Gozer::class ]; + return $app[\Superhelio\Commands\Commands\Gozer::class]; }); $this->commands('command.superhelio.gozer'); } diff --git a/tests/GozerTest.php b/tests/GozerTest.php index a8ed92f..7d05e64 100644 --- a/tests/GozerTest.php +++ b/tests/GozerTest.php @@ -1,4 +1,5 @@ artisan('migrate', ['--database' => 'testbench']); @@ -20,7 +21,7 @@ class GozerTest extends \Orchestra\Testbench\TestCase /** * Define environment setup. * - * @param \Illuminate\Foundation\Application $app + * @param \Illuminate\Foundation\Application $app * * @return void */ @@ -42,7 +43,7 @@ class GozerTest extends \Orchestra\Testbench\TestCase * In a normal app environment these would be added to * the 'providers' array in the config/app.php file. * - * @param \Illuminate\Foundation\Application $app + * @param \Illuminate\Foundation\Application $app * * @return array */ @@ -101,12 +102,12 @@ class GozerTest extends \Orchestra\Testbench\TestCase $connection = $gozer->getConnection(); $tables = $gozer->getTables($connection); - self::assertContains( 'gozerTest__users', $tables ); + self::assertContains('gozerTest__users', $tables); $gozer->setDatabasePrefix('gozerTest__'); $filteredTables = $gozer->getFilteredTables($tables); self::assertTrue(is_a($filteredTables, \Illuminate\Support\Collection::class)); - self::assertContains( 'gozerTest__users', $filteredTables->toArray() ); + self::assertContains('gozerTest__users', $filteredTables->toArray()); } public function test_gozer_table_filtering_works() @@ -123,9 +124,9 @@ class GozerTest extends \Orchestra\Testbench\TestCase $filtered = $gozer->getFilteredTables($tables); $array = $filtered->toArray(); - self::assertNotContains( 'this_should_be_filtered', $array ); - self::assertNotContains( 'filter_me_too', $array ); - self::assertContains( 'gozerTest__users', $array ); - self::assertContains( 'gozerTest__migrations', $array ); + self::assertNotContains('this_should_be_filtered', $array); + self::assertNotContains('filter_me_too', $array); + self::assertContains('gozerTest__users', $array); + self::assertContains('gozerTest__migrations', $array); } } diff --git a/tests/ReloadTest.php b/tests/ReloadTest.php index dea2da6..963dc32 100644 --- a/tests/ReloadTest.php +++ b/tests/ReloadTest.php @@ -1,4 +1,5 @@