Completed
Push — master ( 112898...e2b956 )
by Iman
05:15
created
src/Utils/Normalizer.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
         $contextAs = 'data';
61 61
         if (property_exists($widget, 'contextAs')) {
62 62
             // removes the $ sign.
63
-            $contextAs = str_replace('$', '', (string) $widget->contextAs);
63
+            $contextAs = str_replace('$', '', (string)$widget->contextAs);
64 64
         }
65 65
         $widget->contextAs = $contextAs;
66 66
     }
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,9 +34,9 @@
 block discarded – undo
34 34
     }
35 35
 
36 36
     /**
37
- * Figures out and sets the widget configs according to conventions.
38
- * @param object $widget
39
- */
37
+     * Figures out and sets the widget configs according to conventions.
38
+     * @param object $widget
39
+     */
40 40
     public function normalizeWidgetConfig($widget)
41 41
     {
42 42
         // to avoid normalizing a widget multiple times unnecessarily :
Please login to merge, or discard this patch.
src/Utils/Normalizers/ControllerNormalizer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      */
25 25
     private function checkControllerExists($ctrlClass)
26 26
     {
27
-        if (! class_exists($ctrlClass)) {
27
+        if (!class_exists($ctrlClass)) {
28 28
             throw new \InvalidArgumentException("Controller class: [{$ctrlClass}] not found.");
29 29
         }
30 30
     }
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
      */
35 35
     private function checkDataMethodExists($ctrlClass)
36 36
     {
37
-        if (! method_exists($ctrlClass, 'data')) {
38
-            throw new \InvalidArgumentException("'data' method not found on ".$ctrlClass);
37
+        if (!method_exists($ctrlClass, 'data')) {
38
+            throw new \InvalidArgumentException("'data' method not found on " . $ctrlClass);
39 39
         }
40 40
     }
41 41
 
Please login to merge, or discard this patch.
src/WidgetGenerator.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
         $path = $this->_getViewPath();
52 52
 
53 53
         if ($this->files->exists($path)) {
54
-            $this->error($this->qualifyClass($this->getNameInput())."View.blade.php - Already exists! (@_@)");
54
+            $this->error($this->qualifyClass($this->getNameInput()) . "View.blade.php - Already exists! (@_@)");
55 55
 
56 56
             return;
57 57
         }
58 58
 
59 59
         $this->files->put($path, $this->_getViewStub());
60 60
 
61
-        $this->info(' - '.$this->qualifyClass($this->getNameInput())."View.blade.php - was created. (^_^)");
61
+        $this->info(' - ' . $this->qualifyClass($this->getNameInput()) . "View.blade.php - was created. (^_^)");
62 62
     }
63 63
 
64 64
     /**
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         // to create the class and overwrite the user's code. So, we will bail out so the
123 123
         // code is untouched. Otherwise, we will continue generating this class' files.
124 124
         if ($this->alreadyExists($this->getNameInput())) {
125
-            $this->error($this->qualifyClass($this->getNameInput()).".php - Already exists (@_@)");
125
+            $this->error($this->qualifyClass($this->getNameInput()) . ".php - Already exists (@_@)");
126 126
 
127 127
             return false;
128 128
         }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
         $this->files->put($path, $this->buildClass($name));
136 136
 
137
-        $this->info(' - '.$name.'.php - was created.  (^_^)');
137
+        $this->info(' - ' . $name . '.php - was created.  (^_^)');
138 138
     }
139 139
 
140 140
     /**
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@
 block discarded – undo
110 110
 
111 111
     /**
112 112
      * Creates the widget class
113
-     * @return bool
113
+     * @return false|null
114 114
      */
115 115
     private function _makeWidgetClass()
116 116
     {
Please login to merge, or discard this patch.
src/Utils/Policies.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
      */
24 24
     public function widgetShouldUseCache()
25 25
     {
26
-        return config('widgetize.enable_cache') && (! app()->environment('testing'));
26
+        return config('widgetize.enable_cache') && (!app()->environment('testing'));
27 27
     }
28 28
 
29 29
     /**
Please login to merge, or discard this patch.
src/Utils/Normalizers/TemplateNormalizer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@
 block discarded – undo
17 17
         // replace slashes with dots
18 18
         $className = str_replace(['\\', '/'], '.', $className);
19 19
 
20
-        if (! property_exists($widget, 'template')) {
21
-            $widget->template = 'Widgets::'.$className.'View';
20
+        if (!property_exists($widget, 'template')) {
21
+            $widget->template = 'Widgets::' . $className . 'View';
22 22
         }
23 23
 
24
-        if (! view()->exists($widget->template)) {
25
-            throw new \InvalidArgumentException("View file \"{$widget->template}\" not found by: '".get_class($widget)." '");
24
+        if (!view()->exists($widget->template)) {
25
+            throw new \InvalidArgumentException("View file \"{$widget->template}\" not found by: '" . get_class($widget) . " '");
26 26
         }
27 27
     }
28 28
 }
Please login to merge, or discard this patch.
src/Utils/DebugInfo.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,12 +30,12 @@  discard block
 block discarded – undo
30 30
     {
31 31
         $tpl = $this->widget->template;
32 32
         if (str_contains($tpl, 'Widgets::')) {
33
-            $tpl = str_replace('Widgets::', app()->getNamespace().'Widgets\\', $tpl);
33
+            $tpl = str_replace('Widgets::', app()->getNamespace() . 'Widgets\\', $tpl);
34 34
         }
35 35
 
36 36
         $tpl = str_replace('.', '\\', $tpl);
37 37
 
38
-        $this->html = "<span title='WidgetObj : ".get_class($this->widget).".php&#013;Template : {$tpl}.blade.php{$this->cacheState()}'>{$this->html}</span>";
38
+        $this->html = "<span title='WidgetObj : " . get_class($this->widget) . ".php&#013;Template : {$tpl}.blade.php{$this->cacheState()}'>{$this->html}</span>";
39 39
     }
40 40
 
41 41
     /**
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      */
45 45
     private function cacheState()
46 46
     {
47
-        if (! $this->policies->widgetShouldUseCache()) {
47
+        if (!$this->policies->widgetShouldUseCache()) {
48 48
             return ' &#013;Cache: is globally turned off (You should put "enable_cache" => true in config\widgetize.php) ';
49 49
         }
50 50
 
@@ -53,6 +53,6 @@  discard block
 block discarded – undo
53 53
 
54 54
     private function addHtmlComments()
55 55
     {
56
-        $this->html = "<!-- '{".get_class($this->widget)."' Widget Start -->".$this->html."<!-- '".get_class($this->widget)."' Widget End -->";
56
+        $this->html = "<!-- '{" . get_class($this->widget) . "' Widget Start -->" . $this->html . "<!-- '" . get_class($this->widget) . "' Widget End -->";
57 57
     }
58 58
 }
Please login to merge, or discard this patch.
src/Utils/CacheTag.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      */
52 52
     private function persistToken($tag, $token)
53 53
     {
54
-        \Cache::forever('9z10_o6cg_r'.$tag, $token);
54
+        \Cache::forever('9z10_o6cg_r' . $tag, $token);
55 55
     }
56 56
 
57 57
     /**
@@ -60,6 +60,6 @@  discard block
 block discarded – undo
60 60
      */
61 61
     private function getPersistedToken($tag)
62 62
     {
63
-        return \Cache::get('9z10_o6cg_r'.$tag, null);
63
+        return \Cache::get('9z10_o6cg_r' . $tag, null);
64 64
     }
65 65
 }
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     /**
45 45
      * Set token in Memory for fast access within the same request.
46 46
      * @param $tag string
47
-     * @param $token string
47
+     * @param string $token string
48 48
      * @return string
49 49
      */
50 50
     private function setTokenInMemory($tag, $token)
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     /**
56 56
      * Save token to disk for later requests
57 57
      * @param $tag string
58
-     * @param $token string
58
+     * @param string $token string
59 59
      */
60 60
     private function persistToken($tag, $token)
61 61
     {
Please login to merge, or discard this patch.
src/Utils/Normalizers/CacheNormalizer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
      */
12 12
     public function normalizeCacheLifeTime($widget)
13 13
     {
14
-        if (! property_exists($widget, 'cacheLifeTime')) {
15
-            $widget->cacheLifeTime = (int) (config('widgetize.default_cache_lifetime', 0));
14
+        if (!property_exists($widget, 'cacheLifeTime')) {
15
+            $widget->cacheLifeTime = (int)(config('widgetize.default_cache_lifetime', 0));
16 16
         }
17 17
 
18 18
         if ($widget->cacheLifeTime === 'forever' || $widget->cacheLifeTime < 0) {
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function normalizeCacheTags($widget)
30 30
     {
31
-        if (! property_exists($widget, 'cacheTags')) {
31
+        if (!property_exists($widget, 'cacheTags')) {
32 32
             return $widget->cacheTags = [];
33 33
         }
34 34
 
Please login to merge, or discard this patch.
src/Utils/WidgetRenderer.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
     }
110 110
 
111 111
     /**
112
-     * @param $widget object
112
+     * @param string $widget object
113 113
      * @return \Illuminate\Foundation\Application|mixed
114 114
      */
115 115
     private function _makeWidgetObj($widget)
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     private function _generateHtml($widget, ...$args)
52 52
     {
53 53
         // Everything inside this function is executed only when the cache is not available.
54
-        $expensivePhpCode = function () use ($widget, $args) {
54
+        $expensivePhpCode = function() use ($widget, $args) {
55 55
             $this->makeDataForView($widget, $args);
56 56
             // render the template with the resulting data.
57 57
             return $this->renderTemplate($widget);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     private function _makeWidgetObj($widget)
116 116
     {
117
-        $widget = app()->getNamespace().'Widgets\\'.$widget;
117
+        $widget = app()->getNamespace() . 'Widgets\\' . $widget;
118 118
         return app($widget);
119 119
     }
120 120
 }
Please login to merge, or discard this patch.