| @@ -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 | */ | 
| @@ -89,7 +89,7 @@ discard block | ||
| 89 | 89 | } | 
| 90 | 90 | |
| 91 | 91 |          if (Promocode::insert($records)) { | 
| 92 | -            return collect($records)->map(function ($record) { | |
| 92 | +            return collect($records)->map(function($record) { | |
| 93 | 93 | $record['data'] = json_decode($record['data'], true); | 
| 94 | 94 | |
| 95 | 95 | return $record; | 
| @@ -223,7 +223,7 @@ discard block | ||
| 223 | 223 | */ | 
| 224 | 224 | public function clearRedundant() | 
| 225 | 225 |      { | 
| 226 | -        Promocode::all()->each(function (Promocode $promocode) { | |
| 226 | +        Promocode::all()->each(function(Promocode $promocode) { | |
| 227 | 227 |              if ($promocode->isExpired() || ($promocode->isDisposable() && $promocode->users()->exists()) || $promocode->isOverAmount()) { | 
| 228 | 228 | $promocode->users()->detach(); | 
| 229 | 229 | $promocode->delete(); | 
| @@ -270,8 +270,8 @@ discard block | ||
| 270 | 270 | */ | 
| 271 | 271 | private function getPrefix() | 
| 272 | 272 |      { | 
| 273 | -        return (bool)config('promocodes.prefix') | |
| 274 | -            ? config('promocodes.prefix') . config('promocodes.separator') | |
| 273 | +        return (bool) config('promocodes.prefix') | |
| 274 | +            ? config('promocodes.prefix').config('promocodes.separator') | |
| 275 | 275 | : ''; | 
| 276 | 276 | } | 
| 277 | 277 | |
| @@ -282,8 +282,8 @@ discard block | ||
| 282 | 282 | */ | 
| 283 | 283 | private function getSuffix() | 
| 284 | 284 |      { | 
| 285 | -        return (bool)config('promocodes.suffix') | |
| 286 | -            ? config('promocodes.separator') . config('promocodes.suffix') | |
| 285 | +        return (bool) config('promocodes.suffix') | |
| 286 | +            ? config('promocodes.separator').config('promocodes.suffix') | |
| 287 | 287 | : ''; | 
| 288 | 288 | } | 
| 289 | 289 | |
| @@ -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 | } | 
| @@ -12,7 +12,7 @@ discard block | ||
| 12 | 12 | */ | 
| 13 | 13 | public function up() | 
| 14 | 14 |      { | 
| 15 | -        Schema::table(config('promocodes.table', 'promocodes'), function (Blueprint $table) { | |
| 15 | +        Schema::table(config('promocodes.table', 'promocodes'), function(Blueprint $table) { | |
| 16 | 16 |              $table->integer('amount_codes')->nullable(); | 
| 17 | 17 | }); | 
| 18 | 18 | } | 
| @@ -24,7 +24,7 @@ discard block | ||
| 24 | 24 | */ | 
| 25 | 25 | public function down() | 
| 26 | 26 |      { | 
| 27 | -        Schema::table(config('promocodes.table', 'promocodes'), function (Blueprint $table) { | |
| 27 | +        Schema::table(config('promocodes.table', 'promocodes'), function(Blueprint $table) { | |
| 28 | 28 |              $table->dropColumn('amount_codes'); | 
| 29 | 29 | }); | 
| 30 | 30 | } |