@@ -36,7 +36,7 @@ |
||
36 | 36 | { |
37 | 37 | $this->app->singleton( |
38 | 38 | 'xe.uiobject', |
39 | - function ($app) { |
|
39 | + function($app) { |
|
40 | 40 | |
41 | 41 | $aliases = $app['config']->get('xe.uiobject.aliases'); |
42 | 42 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | { |
37 | 37 | $this->app->singleton( |
38 | 38 | 'xe.uiobject', |
39 | - function ($app) { |
|
39 | + function($app) { |
|
40 | 40 | |
41 | 41 | $aliases = $app['config']->get('xe.uiobject.aliases'); |
42 | 42 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | { |
37 | 37 | $this->app->singleton( |
38 | 38 | 'xe.uiobject', |
39 | - function ($app) { |
|
39 | + function($app) { |
|
40 | 40 | |
41 | 41 | $aliases = $app['config']->get('xe.uiobject.aliases'); |
42 | 42 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | { |
37 | 37 | $this->app->singleton( |
38 | 38 | 'xe.uiobject', |
39 | - function ($app) { |
|
39 | + function($app) { |
|
40 | 40 | |
41 | 41 | $aliases = $app['config']->get('xe.uiobject.aliases'); |
42 | 42 |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | /** |
56 | 56 | * Execute the console command. |
57 | 57 | * |
58 | - * @return bool|null |
|
58 | + * @return false|null |
|
59 | 59 | */ |
60 | 60 | public function fire() |
61 | 61 | { |
@@ -100,6 +100,10 @@ discard block |
||
100 | 100 | $this->info("Input and modify your plugin information in ./plugins/$name/composer.json file."); |
101 | 101 | } |
102 | 102 | |
103 | + /** |
|
104 | + * @param string $path |
|
105 | + * @param string $namespace |
|
106 | + */ |
|
103 | 107 | protected function checkEnv($path, $name, $namespace, $title) |
104 | 108 | { |
105 | 109 | // check directory exists |
@@ -119,9 +123,9 @@ discard block |
||
119 | 123 | /** |
120 | 124 | * makePluginClass |
121 | 125 | * |
122 | - * @param $path |
|
126 | + * @param string $path |
|
123 | 127 | * @param $name |
124 | - * @param $namespace |
|
128 | + * @param string $namespace |
|
125 | 129 | * |
126 | 130 | * @return void |
127 | 131 | */ |
@@ -188,9 +192,9 @@ discard block |
||
188 | 192 | /** |
189 | 193 | * makeComposerJson |
190 | 194 | * |
191 | - * @param $path |
|
195 | + * @param string $path |
|
192 | 196 | * @param $pluginName |
193 | - * @param $namespace |
|
197 | + * @param string $namespace |
|
194 | 198 | * |
195 | 199 | * @return void |
196 | 200 | */ |
@@ -319,7 +323,6 @@ discard block |
||
319 | 323 | /** |
320 | 324 | * Get the full namespace name for a given class. |
321 | 325 | * |
322 | - * @param string $name |
|
323 | 326 | * |
324 | 327 | * @return string |
325 | 328 | */ |
@@ -342,6 +345,7 @@ discard block |
||
342 | 345 | /** |
343 | 346 | * Get the stub file for the generator. |
344 | 347 | * |
348 | + * @param string $filename |
|
345 | 349 | * @return string |
346 | 350 | */ |
347 | 351 | protected function getStub($filename) |
@@ -389,6 +393,9 @@ discard block |
||
389 | 393 | return $this->argument('title'); |
390 | 394 | } |
391 | 395 | |
396 | + /** |
|
397 | + * @param string $path |
|
398 | + */ |
|
392 | 399 | protected function makeDirectoryStructure($path) |
393 | 400 | { |
394 | 401 | $defaultDirectories = [ |
@@ -409,6 +416,9 @@ discard block |
||
409 | 416 | $this->files->put($path.'/assets/style.css', $stub); |
410 | 417 | } |
411 | 418 | |
419 | + /** |
|
420 | + * @param string $path |
|
421 | + */ |
|
412 | 422 | protected function runComposerUpdate($path) |
413 | 423 | { |
414 | 424 | $composer = $this->findComposer(); |
@@ -421,6 +431,10 @@ discard block |
||
421 | 431 | $output = $this->output; |
422 | 432 | |
423 | 433 | $process->run( |
434 | + |
|
435 | + /** |
|
436 | + * @param string $type |
|
437 | + */ |
|
424 | 438 | function ($type, $line) use ($output) { |
425 | 439 | $output->write($line); |
426 | 440 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $title = $this->getTitleInput(); |
59 | 59 | $path = app('xe.plugin')->getPluginsDir().'/'.$name; |
60 | 60 | |
61 | - if($this->checkEnv($path, $name, $namespace, $title) === false) { |
|
61 | + if ($this->checkEnv($path, $name, $namespace, $title) === false) { |
|
62 | 62 | return false; |
63 | 63 | } |
64 | 64 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | } |
103 | 103 | |
104 | 104 | // check namespace |
105 | - if(!str_contains($namespace, '\\')) { |
|
105 | + if (!str_contains($namespace, '\\')) { |
|
106 | 106 | $this->error('The namespace must have at least 1 delimiter(\\), use double backslash(\\\\) as delimiter'); |
107 | 107 | return false; |
108 | 108 | } |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | $output = $this->output; |
422 | 422 | |
423 | 423 | $process->run( |
424 | - function ($type, $line) use ($output) { |
|
424 | + function($type, $line) use ($output) { |
|
425 | 425 | $output->write($line); |
426 | 426 | } |
427 | 427 | ); |
@@ -76,7 +76,7 @@ |
||
76 | 76 | /** |
77 | 77 | * getHandler |
78 | 78 | * |
79 | - * @return FrontendHandler |
|
79 | + * @return Mockery\MockInterface |
|
80 | 80 | */ |
81 | 81 | protected function getHandler() |
82 | 82 | { |
@@ -23,7 +23,7 @@ |
||
23 | 23 | public function testRegister() |
24 | 24 | { |
25 | 25 | $p = new Package('mypackage'); |
26 | - $p->register(function($handler){ |
|
26 | + $p->register(function($handler) { |
|
27 | 27 | }); |
28 | 28 | |
29 | 29 | $packages = Package::packages(); |
@@ -315,6 +315,9 @@ |
||
315 | 315 | ]; |
316 | 316 | } |
317 | 317 | |
318 | + /** |
|
319 | + * @param string $methodName |
|
320 | + */ |
|
318 | 321 | private function invokeMethod(&$object, $methodName, array $parameters = array()) |
319 | 322 | { |
320 | 323 | $reflection = new \ReflectionClass(get_class($object)); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | $instance->shouldReceive('getUrl')->once()->with($mockFile)->andReturnNull(); |
24 | 24 | $instance->shouldReceive('route')->once()->with($mockFile)->andReturn('/url/path'); |
25 | 25 | |
26 | - $closure = function ($file, &$url) { |
|
26 | + $closure = function($file, &$url) { |
|
27 | 27 | $url .= '/1'; |
28 | 28 | }; |
29 | 29 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $mockFile->id = 1; |
42 | 42 | |
43 | 43 | $urlGenerator->shouldReceive('route')->once() |
44 | - ->with(m::on(function () { return true; }), ['id' => 1]) |
|
44 | + ->with(m::on(function() { return true; }), ['id' => 1]) |
|
45 | 45 | ->andReturn(); |
46 | 46 | |
47 | 47 | $instance->route($mockFile); |
@@ -28,7 +28,7 @@ |
||
28 | 28 | // set config to request when rebind request |
29 | 29 | $this->app->rebinding( |
30 | 30 | 'request', |
31 | - function ($app, $request) { |
|
31 | + function($app, $request) { |
|
32 | 32 | return $request->setConfig($app['config']); |
33 | 33 | } |
34 | 34 | ); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | { |
40 | 40 | $this->app->rebinding( |
41 | 41 | 'request', |
42 | - function ($app, $request) { |
|
42 | + function($app, $request) { |
|
43 | 43 | $request->setMobileResolver($this->getMobileResolver()); |
44 | 44 | } |
45 | 45 | ); |
@@ -54,25 +54,25 @@ discard block |
||
54 | 54 | { |
55 | 55 | Blade::directive( |
56 | 56 | 'mobileonly', |
57 | - function ($expression) { |
|
57 | + function($expression) { |
|
58 | 58 | return "<?php if(app('request')->isMobile()) { ?>"; |
59 | 59 | } |
60 | 60 | ); |
61 | 61 | Blade::directive( |
62 | 62 | 'endmobileonly', |
63 | - function ($expression) { |
|
63 | + function($expression) { |
|
64 | 64 | return "<?php } ?>"; |
65 | 65 | } |
66 | 66 | ); |
67 | 67 | Blade::directive( |
68 | 68 | 'desktoponly', |
69 | - function ($expression) { |
|
69 | + function($expression) { |
|
70 | 70 | return "<?php if(!app('request')->isMobile()) { ?>"; |
71 | 71 | } |
72 | 72 | ); |
73 | 73 | Blade::directive( |
74 | 74 | 'enddesktoponly', |
75 | - function ($expression) { |
|
75 | + function($expression) { |
|
76 | 76 | return "<?php } ?>"; |
77 | 77 | } |
78 | 78 | ); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | protected function getMobileResolver() |
82 | 82 | { |
83 | - return function (Request $request, $byUserAgent = false) { |
|
83 | + return function(Request $request, $byUserAgent = false) { |
|
84 | 84 | $app = $this->app; |
85 | 85 | if ($byUserAgent === false) { |
86 | 86 | $isMobile = $request->get('_m', null); |