@@ -74,7 +74,7 @@ |
||
74 | 74 | * |
75 | 75 | * @param string $command |
76 | 76 | * |
77 | - * @return bool |
|
77 | + * @return string |
|
78 | 78 | */ |
79 | 79 | protected function forceCommand($command) |
80 | 80 | { |
@@ -61,7 +61,7 @@ |
||
61 | 61 | * @param \Symfony\Component\Console\Input\InputInterface $input |
62 | 62 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
63 | 63 | * |
64 | - * @return \Symfony\Component\Console\Input\StringInput |
|
64 | + * @return integer |
|
65 | 65 | */ |
66 | 66 | public function run(InputInterface $input, OutputInterface $output) |
67 | 67 | { |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @param \Recca0120\Terminal\TerminalManager $terminalManger |
28 | 28 | * @param string $view |
29 | 29 | * |
30 | - * @return mixed |
|
30 | + * @return \Illuminate\Http\Response |
|
31 | 31 | */ |
32 | 32 | public function index(TerminalManager $terminalManger, $view = 'index') |
33 | 33 | { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * |
52 | 52 | * @param \Recca0120\Terminal\TerminalManager $terminalManger |
53 | 53 | * |
54 | - * @return mixed |
|
54 | + * @return \Illuminate\Http\JsonResponse |
|
55 | 55 | */ |
56 | 56 | public function endpoint(TerminalManager $terminalManger) |
57 | 57 | { |
@@ -7,7 +7,6 @@ |
||
7 | 7 | use Illuminate\Routing\Controller; |
8 | 8 | use Illuminate\Filesystem\Filesystem; |
9 | 9 | use Recca0120\Terminal\TerminalManager; |
10 | -use Illuminate\Contracts\Foundation\Application; |
|
11 | 10 | use Illuminate\Contracts\Routing\ResponseFactory; |
12 | 11 | |
13 | 12 | class TerminalController extends Controller |
@@ -96,7 +96,7 @@ |
||
96 | 96 | ) { |
97 | 97 | $response = $this->responseFactory->make(null, 304, $headers); |
98 | 98 | } else { |
99 | - $response = $this->responseFactory->stream(function () use ($filename) { |
|
99 | + $response = $this->responseFactory->stream(function() use ($filename) { |
|
100 | 100 | $out = fopen('php://output', 'wb'); |
101 | 101 | $file = fopen($filename, 'rb'); |
102 | 102 | stream_copy_to_stream($file, $out, filesize($filename)); |
@@ -24,7 +24,7 @@ |
||
24 | 24 | /** |
25 | 25 | * __construct. |
26 | 26 | * |
27 | - * @param Recca0120\Terminal\Kernel $kernel [description] |
|
27 | + * @param Kernel $kernel [description] |
|
28 | 28 | * @param array $config |
29 | 29 | */ |
30 | 30 | public function __construct(Kernel $kernel, $config = []) |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace Recca0120\Terminal; |
4 | 4 | |
5 | 5 | use Illuminate\Support\Arr; |
6 | -use Illuminate\Contracts\Foundation\Application as Laravel; |
|
7 | 6 | |
8 | 7 | class TerminalManager |
9 | 8 | { |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | /** |
20 | 20 | * Bootstrap any application services. |
21 | 21 | * |
22 | - * @param \Illuminate\Http\Request $Request |
|
22 | + * @param \Illuminate\Http\Request $request |
|
23 | 23 | * @param \Illuminate\Routing\Router $router |
24 | 24 | */ |
25 | 25 | public function boot(Request $request, Router $router) |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | /** |
69 | 69 | * register routes. |
70 | 70 | * |
71 | - * @param Illuminate\Routing\Router $router |
|
71 | + * @param Router $router |
|
72 | 72 | * @param array $config |
73 | 73 | */ |
74 | 74 | protected function handleRoutes(Router $router, $config = []) |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | { |
43 | 43 | $this->mergeConfigFrom(__DIR__.'/../config/terminal.php', 'terminal'); |
44 | 44 | |
45 | - $this->app->singleton(Application::class, function ($app) { |
|
45 | + $this->app->singleton(Application::class, function($app) { |
|
46 | 46 | $config = $app['config']['terminal']; |
47 | 47 | $commands = $config['commands']; |
48 | 48 | $artisan = new Application($app, $app['events'], $app->version()); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | $this->app->singleton(Kernel::class, Kernel::class); |
55 | 55 | |
56 | - $this->app->singleton(TerminalManager::class, function ($app) { |
|
56 | + $this->app->singleton(TerminalManager::class, function($app) { |
|
57 | 57 | $config = $app['config']['terminal']; |
58 | 58 | |
59 | 59 | return new TerminalManager($app->make(Kernel::class), array_merge($config, [ |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | if ($this->app->routesAreCached() === false) { |
77 | 77 | $router->group(array_merge([ |
78 | 78 | 'namespace' => $this->namespace, |
79 | - ], Arr::get($config, 'route', [])), function (Router $router) { |
|
79 | + ], Arr::get($config, 'route', [])), function(Router $router) { |
|
80 | 80 | require __DIR__.'/Http/routes.php'; |
81 | 81 | }); |
82 | 82 | } |
@@ -82,7 +82,7 @@ |
||
82 | 82 | // unset($xdebug); |
83 | 83 | if (function_exists('ini_set')) { |
84 | 84 | @ini_set('display_errors', 1); |
85 | - $memoryInBytes = function ($value) { |
|
85 | + $memoryInBytes = function($value) { |
|
86 | 86 | $unit = strtolower(substr($value, -1, 1)); |
87 | 87 | $value = (int) $value; |
88 | 88 | switch ($unit) { |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | (new Collection( |
76 | 76 | Glob::glob($root.'{'.(new Collection(Glob::glob($root.'vendor/*/*'))) |
77 | - ->map(function ($item) { |
|
77 | + ->map(function($item) { |
|
78 | 78 | return substr($item, strpos($item, 'vendor')); |
79 | 79 | }) |
80 | 80 | ->implode(',').'}/**/{'.(implode(',', array_merge($vcs, $common, $others, $tests, $docs))).'}') |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $root.'vendor/phpunit', |
85 | 85 | ]) |
86 | 86 | ->filter() |
87 | - ->each(function ($item) { |
|
87 | + ->each(function($item) { |
|
88 | 88 | if ($this->filesystem->isDirectory($item) === true) { |
89 | 89 | $this->filesystem->deleteDirectory($item); |
90 | 90 | $this->info('delete directory: '.$item); |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | $path = rtrim($path, '/').'/'; |
61 | 61 | |
62 | 62 | $file = (new Collection($this->filesystem->glob($path.'logs/*.log'))) |
63 | - ->map(function ($file) { |
|
63 | + ->map(function($file) { |
|
64 | 64 | return is_file($file) === true ? $file : false; |
65 | - })->sortByDesc(function ($file) { |
|
65 | + })->sortByDesc(function($file) { |
|
66 | 66 | return filectime($file); |
67 | 67 | })->first(); |
68 | 68 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $fp = fopen($file, 'r'); |
92 | 92 | $i = 1; |
93 | 93 | $result = []; |
94 | - while (! feof($fp)) { |
|
94 | + while (!feof($fp)) { |
|
95 | 95 | if ($i > $lines) { |
96 | 96 | break; |
97 | 97 | } |