@@ -40,11 +40,11 @@ discard block |
||
| 40 | 40 | { |
| 41 | 41 | if ($this->app->runningInConsole()) { |
| 42 | 42 | $this->publishes([ |
| 43 | - __DIR__.'/../config/temp_tag.php' => config_path('tag.php'), |
|
| 43 | + __DIR__ . '/../config/temp_tag.php' => config_path('tag.php'), |
|
| 44 | 44 | ], 'tag-config'); |
| 45 | 45 | |
| 46 | 46 | $this->publishes([ |
| 47 | - __DIR__.'/../database/migrations' => database_path('migrations'), |
|
| 47 | + __DIR__ . '/../database/migrations' => database_path('migrations'), |
|
| 48 | 48 | ], 'migrations'); |
| 49 | 49 | } |
| 50 | 50 | |
@@ -54,14 +54,14 @@ discard block |
||
| 54 | 54 | private function registerMigrations() |
| 55 | 55 | { |
| 56 | 56 | if ($this->app->runningInConsole() && $this->shouldLoadDefaultMigrations()) { |
| 57 | - $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); |
|
| 57 | + $this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | private function configure() |
| 62 | 62 | { |
| 63 | - if (! $this->app->configurationIsCached()) { |
|
| 64 | - $this->mergeConfigFrom(__DIR__.'/../config/temp_tag.php', 'tag'); |
|
| 63 | + if (!$this->app->configurationIsCached()) { |
|
| 64 | + $this->mergeConfigFrom(__DIR__ . '/../config/temp_tag.php', 'tag'); |
|
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | static function registerRelationship($q) |
| 74 | 74 | { |
| 75 | 75 | $table = $q->getModel()->getTable(); |
| 76 | - if (! in_array($table, TempTagServiceProvider::$registeredRelation)) { |
|
| 76 | + if (!in_array($table, TempTagServiceProvider::$registeredRelation)) { |
|
| 77 | 77 | TempTagServiceProvider::$registeredRelation[] = $table; |
| 78 | 78 | Relation::morphMap([$table => get_class($q->getModel())]); |
| 79 | 79 | } |
@@ -81,10 +81,10 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | static function getClosure($title, $payload) |
| 83 | 83 | { |
| 84 | - return function ($q) use ($title, $payload) { |
|
| 84 | + return function($q) use ($title, $payload) { |
|
| 85 | 85 | $q->whereIn('title', (array) $title); |
| 86 | 86 | if ($payload) { |
| 87 | - $q->where('payload->'.$payload[0], $payload[1]); |
|
| 87 | + $q->where('payload->' . $payload[0], $payload[1]); |
|
| 88 | 88 | } |
| 89 | 89 | }; |
| 90 | 90 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | private function whereHasClosure($relation) |
| 108 | 108 | { |
| 109 | - return function ($title, $payload) use($relation) { |
|
| 109 | + return function($title, $payload) use($relation) { |
|
| 110 | 110 | TempTagServiceProvider::registerRelationship($this); |
| 111 | 111 | |
| 112 | 112 | return $this->whereHas($relation, TempTagServiceProvider::getClosure($title, $payload)); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | private function whereHasNotClosure($relation) |
| 117 | 117 | { |
| 118 | - return function ($title, $payload) use($relation) { |
|
| 118 | + return function($title, $payload) use($relation) { |
|
| 119 | 119 | TempTagServiceProvider::registerRelationship($this); |
| 120 | 120 | |
| 121 | 121 | return $this->whereDoesntHave($relation, TempTagServiceProvider::getClosure($title, $payload)); |
@@ -89,21 +89,21 @@ |
||
| 89 | 89 | ]; |
| 90 | 90 | |
| 91 | 91 | assert($res === [ |
| 92 | - null, |
|
| 93 | - null, |
|
| 94 | - null, |
|
| 92 | + null, |
|
| 93 | + null, |
|
| 94 | + null, |
|
| 95 | 95 | |
| 96 | - null, |
|
| 97 | - null, |
|
| 98 | - null, |
|
| 96 | + null, |
|
| 97 | + null, |
|
| 98 | + null, |
|
| 99 | 99 | |
| 100 | - 'covid19', |
|
| 101 | - 'covid19', |
|
| 102 | - null, |
|
| 100 | + 'covid19', |
|
| 101 | + 'covid19', |
|
| 102 | + null, |
|
| 103 | 103 | |
| 104 | - 'superman', |
|
| 105 | - 2, |
|
| 106 | - ]); |
|
| 104 | + 'superman', |
|
| 105 | + 2, |
|
| 106 | + ]); |
|
| 107 | 107 | |
| 108 | 108 | // =================== test deleted tag ===================== |
| 109 | 109 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | { |
| 16 | 16 | parent::setUp(); |
| 17 | 17 | |
| 18 | - $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); |
|
| 19 | - $this->loadMigrationsFrom(__DIR__.'/Requirements/Database/Migrations'); |
|
| 18 | + $this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); |
|
| 19 | + $this->loadMigrationsFrom(__DIR__ . '/Requirements/Database/Migrations'); |
|
| 20 | 20 | } |
| 21 | 21 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('users', function (Blueprint $table) { |
|
| 16 | + Schema::create('users', function(Blueprint $table) { |
|
| 17 | 17 | $table->bigIncrements('id'); |
| 18 | 18 | $table->string('username')->nullable(); |
| 19 | 19 | $table->string('email')->unique(); |