@@ -17,7 +17,7 @@ |
||
| 17 | 17 | public function authorize($ability, $arguments = []) |
| 18 | 18 | { |
| 19 | 19 | return $this->baseAuthorize( |
| 20 | - 'static-page.' . $ability, |
|
| 20 | + 'static-page.'.$ability, |
|
| 21 | 21 | $arguments |
| 22 | 22 | ); |
| 23 | 23 | } |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | |
| 56 | 56 | public function baseDirectory() |
| 57 | 57 | { |
| 58 | - return __DIR__ . '/..'; |
|
| 58 | + return __DIR__.'/..'; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | public function boot() |
@@ -23,17 +23,17 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | public function isComplete($settings, ActivityInstance $activityInstance, ModuleInstance $moduleInstance): bool |
| 25 | 25 | { |
| 26 | - return PageView::forResource($activityInstance->id, $moduleInstance->id)->count() >= ( $settings['number_of_views'] ?? 1); |
|
| 26 | + return PageView::forResource($activityInstance->id, $moduleInstance->id)->count() >= ($settings['number_of_views'] ?? 1); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | public function percentage($settings, ActivityInstance $activityInstance, ModuleInstance $moduleInstance): int |
| 30 | 30 | { |
| 31 | 31 | $count = PageView::forResource($activityInstance->id, $moduleInstance->id)->count(); |
| 32 | - $needed = ( $settings['number_of_views'] ?? 1); |
|
| 32 | + $needed = ($settings['number_of_views'] ?? 1); |
|
| 33 | 33 | |
| 34 | - $percentage = (int) round(($count/$needed) * 100, 0); |
|
| 34 | + $percentage = (int) round(($count / $needed) * 100, 0); |
|
| 35 | 35 | |
| 36 | - if($percentage > 100) { |
|
| 36 | + if ($percentage > 100) { |
|
| 37 | 37 | return 100; |
| 38 | 38 | } |
| 39 | 39 | return $percentage; |