@@ -81,12 +81,12 @@ |
||
| 81 | 81 | protected function createAchievement(array $achievement) |
| 82 | 82 | { |
| 83 | 83 | DB::table('achievements')->insert( |
| 84 | - array_only($achievement, ['id', 'name', 'description', 'points', 'created_at', 'updated_at']) |
|
| 84 | + array_only($achievement, [ 'id', 'name', 'description', 'points', 'created_at', 'updated_at' ]) |
|
| 85 | 85 | ); |
| 86 | 86 | |
| 87 | - foreach ($achievement['criterias'] as $criteria) { |
|
| 87 | + foreach ($achievement[ 'criterias' ] as $criteria) { |
|
| 88 | 88 | DB::table('achievement_criterias')->insert( |
| 89 | - array_merge($criteria, ['achievement_id' => $achievement['id']]) |
|
| 89 | + array_merge($criteria, [ 'achievement_id' => $achievement[ 'id' ] ]) |
|
| 90 | 90 | ); |
| 91 | 91 | } |
| 92 | 92 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('achievement_criterias', function (Blueprint $table) { |
|
| 16 | + Schema::create('achievement_criterias', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->unsignedInteger('achievement_id')->index(); |
| 19 | 19 | $table->string('type')->index(); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('achievementables', function (Blueprint $table) { |
|
| 16 | + Schema::create('achievementables', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('achievementable_type')->index(); |
| 19 | 19 | $table->unsignedInteger('achievementable_id')->index(); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('achievement_criteriables', function (Blueprint $table) { |
|
| 16 | + Schema::create('achievement_criteriables', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('achievement_criteriable_type')->index(); |
| 19 | 19 | $table->unsignedInteger('achievement_criteriable_id')->index(); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('achievements', function (Blueprint $table) { |
|
| 16 | + Schema::create('achievements', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('name')->nullable(); |
| 19 | 19 | $table->text('description')->nullable(); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | public function achievements() |
| 22 | 22 | { |
| 23 | 23 | return $this->morphToMany(AchievementModel::class, 'achievementable') |
| 24 | - ->withPivot(['completed_at']); |
|
| 24 | + ->withPivot([ 'completed_at' ]); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -42,6 +42,6 @@ discard block |
||
| 42 | 42 | public function achievementCriterias() |
| 43 | 43 | { |
| 44 | 44 | return $this->morphToMany(AchievementCriteriaModel::class, 'achievement_criteriable') |
| 45 | - ->withPivot(['value', 'completed', 'updated_at']); |
|
| 45 | + ->withPivot([ 'value', 'completed', 'updated_at' ]); |
|
| 46 | 46 | } |
| 47 | 47 | } |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | * |
| 10 | 10 | * @var array |
| 11 | 11 | */ |
| 12 | - public $achievements = []; |
|
| 12 | + public $achievements = [ ]; |
|
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | 15 | * AchievementsCompleted constructor. |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | { |
| 27 | 27 | $this->app->bind(AchievementsStorageInterface::class, AchievementsStorage::class); |
| 28 | 28 | |
| 29 | - $this->app->singleton(AchievementsManager::class, function () { |
|
| 29 | + $this->app->singleton(AchievementsManager::class, function() { |
|
| 30 | 30 | $storage = app(AchievementsStorageInterface::class); |
| 31 | 31 | |
| 32 | 32 | return new AchievementsManager($storage); |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | |
| 61 | 61 | $instance = app($criteria); |
| 62 | 62 | |
| 63 | - AchievementsManager::registerHandler($instance->type(), [$instance, 'handle']); |
|
| 63 | + AchievementsManager::registerHandler($instance->type(), [ $instance, 'handle' ]); |
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | } |