Completed
Branch master (9fd700)
by Iman
05:17
created
src/WidgetGenerator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
     protected function getStub()
36 36
     {
37 37
        
38
-		return __DIR__.'/../stubs/widget.stub';
38
+		return __DIR__ . '/../stubs/widget.stub';
39 39
        
40 40
     }
41 41
 
Please login to merge, or discard this patch.
src/BaseWidget.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -60,15 +60,15 @@  discard block
 block discarded – undo
60 60
             $presenter = get_called_class() . 'Presenter';
61 61
 
62 62
             if (class_exists($presenter)) {
63
-                $this->presenter = $presenter.'@presenter';
64
-            }else{
63
+                $this->presenter = $presenter . '@presenter';
64
+            } else {
65 65
                 $this->presenter = null;
66 66
             }
67 67
         } else {
68 68
             if (class_exists($this->presenter) === false) {
69 69
                 throw new \InvalidArgumentException("Presenter Class [{$this->presenter}] not found.");
70 70
             }
71
-            $this->presenter = $this->presenter.'@present';
71
+            $this->presenter = $this->presenter . '@present';
72 72
         }
73 73
 
74 74
     }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     private function generateHtml(...$args)
143 143
     {
144 144
         // Everything inside this function is executed only when the cache is not available.
145
-        $expensivePhpCode = function () use ($args) {
145
+        $expensivePhpCode = function() use ($args) {
146 146
             $this->prepareDataForView($args);
147 147
 
148 148
             // render the template with the resulting data.
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
         // We add some HTML comments before and after the widget output
191 191
         // So then, we will be able to easily identify the widget in browser's developer tool.
192
-        if (env('WIDGET_IDENTIFIER', true) and env('APP_ENV','production') === 'local') {
192
+        if (env('WIDGET_IDENTIFIER', true) and env('APP_ENV', 'production') === 'local') {
193 193
             $this->addIdentifierToHtml();
194 194
         }
195 195
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
     private function addIdentifierToHtml()
227 227
     {
228 228
         $name = $this->friendlyName;
229
-        $this->html = "<div title='". get_called_class() . "::class || template : {$this->template}".$this->cacheState()."style='box-shadow: 0px 0px 15px 5px #00c62b inset'>" . $this->html ."</div>";
229
+        $this->html = "<div title='" . get_called_class() . "::class || template : {$this->template}" . $this->cacheState() . "style='box-shadow: 0px 0px 15px 5px #00c62b inset'>" . $this->html . "</div>";
230 230
         $this->html = "<!-- '$name' Widget Start -->" . $this->html . "<!-- '$name' Widget End -->";
231 231
     }
232 232
 
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
     {
260 260
         $cache = app()->make('cache');
261 261
 
262
-        if($this->cacheTags){
262
+        if ($this->cacheTags) {
263 263
             $cache = $cache->tags($this->cacheTags);
264 264
         }
265 265
 
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
      */
287 287
     private function cacheShouldBeTagged()
288 288
     {
289
-        return !in_array(env('CACHE_DRIVER','file'), ['file', 'database']) and $this->cacheTags;
289
+        return !in_array(env('CACHE_DRIVER', 'file'), ['file', 'database']) and $this->cacheTags;
290 290
     }
291 291
 
292 292
     /**
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
      */
295 295
     private function cacheState()
296 296
     {
297
-        if($this->widgetShouldUseCache()){
297
+        if ($this->widgetShouldUseCache()) {
298 298
             return " || cache: {$this->cacheLifeTime}(min)' ";
299 299
         }
300 300
         return  " || cache : off";
Please login to merge, or discard this patch.
src/WidgetsServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	 */
15 15
 	public function boot()
16 16
 	{
17
-        $this->loadViewsFrom($this->app->basePath().'/app/Widgets/', 'Widgets');
17
+        $this->loadViewsFrom($this->app->basePath() . '/app/Widgets/', 'Widgets');
18 18
 	}
19 19
 
20 20
 	/**
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 */
29 29
 	public function register()
30 30
 	{
31
-		$this->app->singleton('command.imanghafoori.widget', function ($app) {
31
+		$this->app->singleton('command.imanghafoori.widget', function($app) {
32 32
             return $app['Imanghafoori\Widgets\WidgetGenerator'];
33 33
         });
34 34
 		
Please login to merge, or discard this patch.