@@ -12,7 +12,7 @@ discard block  | 
                                                    ||
| 12 | 12 | */  | 
                                                        
| 13 | 13 | public function up()  | 
                                                        
| 14 | 14 |      { | 
                                                        
| 15 | -        Schema::create(config('promocodes.table', 'promocodes'), function (Blueprint $table) { | 
                                                        |
| 15 | +        Schema::create(config('promocodes.table', 'promocodes'), function(Blueprint $table) { | 
                                                        |
| 16 | 16 |              $table->increments('id'); | 
                                                        
| 17 | 17 | |
| 18 | 18 |              $table->string('code', 32)->unique(); | 
                                                        
@@ -24,7 +24,7 @@ discard block  | 
                                                    ||
| 24 | 24 |              $table->timestamp('expires_at')->nullable(); | 
                                                        
| 25 | 25 | });  | 
                                                        
| 26 | 26 | |
| 27 | -        Schema::create(config('promocodes.relation_table', 'promocode_user'), function (Blueprint $table) { | 
                                                        |
| 27 | +        Schema::create(config('promocodes.relation_table', 'promocode_user'), function(Blueprint $table) { | 
                                                        |
| 28 | 28 |              $table->unsignedInteger('user_id'); | 
                                                        
| 29 | 29 |              $table->unsignedInteger('promocode_id'); | 
                                                        
| 30 | 30 | |
@@ -32,7 +32,7 @@ discard block  | 
                                                    ||
| 32 | 32 | /** @test */  | 
                                                        
| 33 | 33 | public function it_returns_null_in_callback_if_could_not_apply_promocode()  | 
                                                        
| 34 | 34 |      { | 
                                                        
| 35 | -        $this->user->applyCode('INVALID-CODE', function ($applyCode) { | 
                                                        |
| 35 | +        $this->user->applyCode('INVALID-CODE', function($applyCode) { | 
                                                        |
| 36 | 36 | $this->assertNull($applyCode);  | 
                                                        
| 37 | 37 | });  | 
                                                        
| 38 | 38 | }  | 
                                                        
@@ -91,7 +91,7 @@ discard block  | 
                                                    ||
| 91 | 91 | |
| 92 | 92 | $this->assertCount(1, $promocodes);  | 
                                                        
| 93 | 93 | |
| 94 | -        $this->user->applyCode($promocode['code'], function ($appliedPromocode) { | 
                                                        |
| 94 | +        $this->user->applyCode($promocode['code'], function($appliedPromocode) { | 
                                                        |
| 95 | 95 | $this->assertTrue($appliedPromocode instanceof Promocode);  | 
                                                        
| 96 | 96 | });  | 
                                                        
| 97 | 97 | }  | 
                                                        
@@ -119,7 +119,7 @@ discard block  | 
                                                    ||
| 119 | 119 | *  | 
                                                        
| 120 | 120 | * @param string $code  | 
                                                        
| 121 | 121 | *  | 
                                                        
| 122 | - * @return bool|Promocode  | 
                                                        |
| 122 | + * @return Promocode  | 
                                                        |
| 123 | 123 | * @throws InvalidPromocodeException  | 
                                                        
| 124 | 124 | */  | 
                                                        
| 125 | 125 | public function check($code)  | 
                                                        
@@ -282,7 +282,7 @@ discard block  | 
                                                    ||
| 282 | 282 | * Your code will be validated to be unique for one request.  | 
                                                        
| 283 | 283 | *  | 
                                                        
| 284 | 284 | * @param $collection  | 
                                                        
| 285 | - * @param $new  | 
                                                        |
| 285 | + * @param string $new  | 
                                                        |
| 286 | 286 | *  | 
                                                        
| 287 | 287 | * @return bool  | 
                                                        
| 288 | 288 | */  | 
                                                        
@@ -87,7 +87,7 @@ discard block  | 
                                                    ||
| 87 | 87 | }  | 
                                                        
| 88 | 88 | |
| 89 | 89 |          if (Promocode::insert($records)) { | 
                                                        
| 90 | -            return collect($records)->map(function ($record) { | 
                                                        |
| 90 | +            return collect($records)->map(function($record) { | 
                                                        |
| 91 | 91 | $record['data'] = json_decode($record['data'], true);  | 
                                                        
| 92 | 92 | |
| 93 | 93 | return $record;  | 
                                                        
@@ -214,7 +214,7 @@ discard block  | 
                                                    ||
| 214 | 214 | */  | 
                                                        
| 215 | 215 | public function clearRedundant()  | 
                                                        
| 216 | 216 |      { | 
                                                        
| 217 | -        Promocode::all()->each(function (Promocode $promocode) { | 
                                                        |
| 217 | +        Promocode::all()->each(function(Promocode $promocode) { | 
                                                        |
| 218 | 218 |              if ($promocode->isExpired() || ($promocode->isDisposable() && $promocode->users()->exists())) { | 
                                                        
| 219 | 219 | $promocode->users()->detach();  | 
                                                        
| 220 | 220 | $promocode->delete();  | 
                                                        
@@ -261,8 +261,8 @@ discard block  | 
                                                    ||
| 261 | 261 | */  | 
                                                        
| 262 | 262 | private function getPrefix()  | 
                                                        
| 263 | 263 |      { | 
                                                        
| 264 | -        return (bool)config('promocodes.prefix') | 
                                                        |
| 265 | -            ? config('promocodes.prefix') . config('promocodes.separator') | 
                                                        |
| 264 | +        return (bool) config('promocodes.prefix') | 
                                                        |
| 265 | +            ? config('promocodes.prefix').config('promocodes.separator') | 
                                                        |
| 266 | 266 | : '';  | 
                                                        
| 267 | 267 | }  | 
                                                        
| 268 | 268 | |
@@ -273,8 +273,8 @@ discard block  | 
                                                    ||
| 273 | 273 | */  | 
                                                        
| 274 | 274 | private function getSuffix()  | 
                                                        
| 275 | 275 |      { | 
                                                        
| 276 | -        return (bool)config('promocodes.suffix') | 
                                                        |
| 277 | -            ? config('promocodes.separator') . config('promocodes.suffix') | 
                                                        |
| 276 | +        return (bool) config('promocodes.suffix') | 
                                                        |
| 277 | +            ? config('promocodes.separator').config('promocodes.suffix') | 
                                                        |
| 278 | 278 | : '';  | 
                                                        
| 279 | 279 | }  | 
                                                        
| 280 | 280 | |
@@ -14,11 +14,11 @@ discard block  | 
                                                    ||
| 14 | 14 | public function boot()  | 
                                                        
| 15 | 15 |      { | 
                                                        
| 16 | 16 | $this->publishes([  | 
                                                        
| 17 | -            __DIR__ . '/../config/promocodes.php' => config_path('promocodes.php'), | 
                                                        |
| 17 | +            __DIR__.'/../config/promocodes.php' => config_path('promocodes.php'), | 
                                                        |
| 18 | 18 | ]);  | 
                                                        
| 19 | 19 | |
| 20 | 20 | $this->publishes([  | 
                                                        
| 21 | -            __DIR__ . '/../migrations' => database_path('migrations'), | 
                                                        |
| 21 | +            __DIR__.'/../migrations' => database_path('migrations'), | 
                                                        |
| 22 | 22 | ], 'migrations');  | 
                                                        
| 23 | 23 | }  | 
                                                        
| 24 | 24 | |
@@ -30,10 +30,10 @@ discard block  | 
                                                    ||
| 30 | 30 | public function register()  | 
                                                        
| 31 | 31 |      { | 
                                                        
| 32 | 32 | $this->mergeConfigFrom(  | 
                                                        
| 33 | - __DIR__ . '/../config/promocodes.php', 'promocodes'  | 
                                                        |
| 33 | + __DIR__.'/../config/promocodes.php', 'promocodes'  | 
                                                        |
| 34 | 34 | );  | 
                                                        
| 35 | 35 | |
| 36 | -        $this->app->singleton('promocodes', function ($app) { | 
                                                        |
| 36 | +        $this->app->singleton('promocodes', function($app) { | 
                                                        |
| 37 | 37 | return new Promocodes();  | 
                                                        
| 38 | 38 | });  | 
                                                        
| 39 | 39 | }  |