@@ -43,7 +43,7 @@ |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | - * @param $widget object |
|
| 46 | + * @param string $widget object |
|
| 47 | 47 | * @return \Illuminate\Foundation\Application|mixed |
| 48 | 48 | */ |
| 49 | 49 | private function makeWidgetObj($widget) |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | return app($widget); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - $widget = app()->getNamespace().'Widgets\\'.$widget; |
|
| 55 | + $widget = app()->getNamespace() . 'Widgets\\' . $widget; |
|
| 56 | 56 | |
| 57 | 57 | return app($widget); |
| 58 | 58 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | private function generateHtml($widget, ...$args) |
| 69 | 69 | { |
| 70 | 70 | // Everything inside this function is executed only when the cache is not available. |
| 71 | - $expensivePhpCode = function () use ($widget, $args) { |
|
| 71 | + $expensivePhpCode = function() use ($widget, $args) { |
|
| 72 | 72 | $this->makeDataForView($widget, $args); |
| 73 | 73 | |
| 74 | 74 | // render the template with the resulting data. |
@@ -111,7 +111,7 @@ |
||
| 111 | 111 | |
| 112 | 112 | /** |
| 113 | 113 | * Creates the widget class. |
| 114 | - * @return bool |
|
| 114 | + * @return false|null |
|
| 115 | 115 | */ |
| 116 | 116 | private function makeWidgetClass() |
| 117 | 117 | { |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | $this->makeWidgetClass(); |
| 38 | 38 | |
| 39 | - if (! $this->option('plain')) { |
|
| 39 | + if (!$this->option('plain')) { |
|
| 40 | 40 | $this->createView(); |
| 41 | 41 | } |
| 42 | 42 | } |
@@ -51,14 +51,14 @@ discard block |
||
| 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 | /** |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | $stubName = $this->option('plain') ? 'widget_plain' : 'widget'; |
| 72 | 72 | |
| 73 | - return __DIR__."/../stubs/$stubName.stub"; |
|
| 73 | + return __DIR__ . "/../stubs/$stubName.stub"; |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | protected function getDefaultNamespace($rootNamespace) |
| 84 | 84 | { |
| 85 | - return $rootNamespace.'\\Widgets'; |
|
| 85 | + return $rootNamespace . '\\Widgets'; |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | // to create the class and overwrite the user's code. So, we will bail out so the |
| 124 | 124 | // code is untouched. Otherwise, we will continue generating this class' files. |
| 125 | 125 | if ($this->alreadyExists($this->getNameInput())) { |
| 126 | - $this->error($this->qualifyClass($this->getNameInput()).'.php - Already exists (@_@)'); |
|
| 126 | + $this->error($this->qualifyClass($this->getNameInput()) . '.php - Already exists (@_@)'); |
|
| 127 | 127 | |
| 128 | 128 | return false; |
| 129 | 129 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | $this->files->put($path, $this->buildClass($name)); |
| 137 | 137 | |
| 138 | - $this->info(' - '.$name.'.php - was created. (^_^)'); |
|
| 138 | + $this->info(' - ' . $name . '.php - was created. (^_^)'); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /** |