@@ -52,8 +52,8 @@ |
||
52 | 52 | { |
53 | 53 | if (Schema::hasTable('system_settings')) { |
54 | 54 | $settings = [ |
55 | - 'default_reading_speed' => Settings::DEFAULT_READING_SPEED, |
|
56 | - 'rounding_up_enabled' => Settings::DEFAULT_ROUNDING_UP_ENABLED |
|
55 | + 'default_reading_speed' => Settings::DEFAULT_READING_SPEED, |
|
56 | + 'rounding_up_enabled' => Settings::DEFAULT_ROUNDING_UP_ENABLED |
|
57 | 57 | ]; |
58 | 58 | |
59 | 59 | DB::table('system_settings')->insert( |
@@ -57,7 +57,7 @@ |
||
57 | 57 | ]; |
58 | 58 | |
59 | 59 | DB::table('system_settings')->insert( |
60 | - ['item' => Settings::SETTINGS_CODE, 'value' => json_encode($settings)] |
|
60 | + [ 'item' => Settings::SETTINGS_CODE, 'value' => json_encode($settings) ] |
|
61 | 61 | ); |
62 | 62 | } |
63 | 63 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * |
77 | 77 | * @return array |
78 | 78 | */ |
79 | - public function registerSettings(){ |
|
79 | + public function registerSettings() { |
|
80 | 80 | return [ |
81 | 81 | 'settings' => [ |
82 | 82 | 'label' => self::LOCALIZATION_KEY . 'settings.name', |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | { |
96 | 96 | return [ |
97 | 97 | 'filters' => [ |
98 | - 'timeToRead' => [$this, 'getTimeToRead'] |
|
98 | + 'timeToRead' => [ $this, 'getTimeToRead' ] |
|
99 | 99 | ] |
100 | 100 | ]; |
101 | 101 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | private function extendModel() |
125 | 125 | { |
126 | - PostModel::extend(function ($model) { |
|
126 | + PostModel::extend(function($model) { |
|
127 | 127 | $model->addDynamicMethod('getTimeToReadAttribute', function() use ($model) { |
128 | 128 | return $this->helper->calculate($model->content); |
129 | 129 | }); |
@@ -20,13 +20,13 @@ |
||
20 | 20 | |
21 | 21 | const SETTINGS_CODE = 'ginopane_blogtimetoread'; |
22 | 22 | |
23 | - public $implement = [SettingsModel::class]; |
|
23 | + public $implement = [ SettingsModel::class ]; |
|
24 | 24 | |
25 | 25 | public $settingsCode = self::SETTINGS_CODE; |
26 | 26 | |
27 | 27 | public $settingsFields = 'fields.yaml'; |
28 | 28 | |
29 | - protected $cache = []; |
|
29 | + protected $cache = [ ]; |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * @return int |
@@ -33,16 +33,16 @@ |
||
33 | 33 | * |
34 | 34 | * @return int |
35 | 35 | */ |
36 | - public function calculate(string $text, array $options = []): int |
|
36 | + public function calculate(string $text, array $options = [ ]): int |
|
37 | 37 | { |
38 | 38 | $readingSpeed = abs( |
39 | - isset($options[Settings::READING_SPEED_KEY]) |
|
40 | - ? (int)$options[Settings::READING_SPEED_KEY] |
|
39 | + isset($options[ Settings::READING_SPEED_KEY ]) |
|
40 | + ? (int)$options[ Settings::READING_SPEED_KEY ] |
|
41 | 41 | : $this->settings->readingSpeed() |
42 | 42 | ); |
43 | 43 | |
44 | - $isRoundingUpEnabled = isset($options[Settings::ROUNDING_UP_ENABLED_KEY]) |
|
45 | - ? (bool)$options[Settings::ROUNDING_UP_ENABLED_KEY] |
|
44 | + $isRoundingUpEnabled = isset($options[ Settings::ROUNDING_UP_ENABLED_KEY ]) |
|
45 | + ? (bool)$options[ Settings::ROUNDING_UP_ENABLED_KEY ] |
|
46 | 46 | : $this->settings->isRoundingUpEnabled(); |
47 | 47 | |
48 | 48 | if (!$readingSpeed) { |