@@ -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(); |
@@ -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. |
@@ -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 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | $this->app->bind(AchievementsStorageInterface::class, AchievementsStorage::class); |
34 | 34 | |
35 | - $this->app->singleton(AchievementsManager::class, function () { |
|
35 | + $this->app->singleton(AchievementsManager::class, function() { |
|
36 | 36 | $storage = app(AchievementsStorageInterface::class); |
37 | 37 | |
38 | 38 | return new AchievementsManager($storage); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | 'achievementables', |
24 | 24 | null, |
25 | 25 | 'achievement_model_id' |
26 | - )->withPivot(['completed_at']); |
|
26 | + )->withPivot([ 'completed_at' ]); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -49,6 +49,6 @@ discard block |
||
49 | 49 | 'achievement_criteriables', |
50 | 50 | null, |
51 | 51 | 'achievement_criteria_model_id' |
52 | - )->withPivot(['value', 'completed', 'progress_data', 'updated_at']); |
|
52 | + )->withPivot([ 'value', 'completed', 'progress_data', 'updated_at' ]); |
|
53 | 53 | } |
54 | 54 | } |