Passed
Branch master (2ce0b0)
by Gino
09:26
created
updates/populate_default_settings.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,8 @@
 block discarded – undo
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(
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
Plugin.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
             });
Please login to merge, or discard this patch.
models/Settings.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,13 +20,13 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
helpers/TimeToRead.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,16 +33,16 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.