We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -15,7 +15,7 @@ |
||
15 | 15 | (array) config('backpack.base.middleware_key', 'admin') |
16 | 16 | ), |
17 | 17 | 'namespace' => 'App\Http\Controllers\Admin', |
18 | -], function () { // custom admin routes |
|
18 | +], function() { // custom admin routes |
|
19 | 19 | }); // this should be the absolute last line of this file |
20 | 20 | |
21 | 21 | /** |
@@ -46,10 +46,10 @@ discard block |
||
46 | 46 | // check if the file exists |
47 | 47 | if (!file_exists($routeFilePath)) { |
48 | 48 | $this->line("The route file <fg=blue>$routeFilePath</> does not exist."); |
49 | - $createRouteFile = $this->confirm('Should we create the file in <fg=blue>'. $routeFilePath . '</> ?', 'yes'); |
|
50 | - if($createRouteFile) { |
|
49 | + $createRouteFile = $this->confirm('Should we create the file in <fg=blue>'.$routeFilePath.'</> ?', 'yes'); |
|
50 | + if ($createRouteFile) { |
|
51 | 51 | $this->call('vendor:publish', ['--provider' => \Backpack\CRUD\BackpackServiceProvider::class, '--tag' => 'custom_routes']); |
52 | - }else{ |
|
52 | + } else { |
|
53 | 53 | $this->error('The route file does not exist. Please create it first.'); |
54 | 54 | } |
55 | 55 | |
@@ -74,16 +74,16 @@ discard block |
||
74 | 74 | // get the last element of the array contains '}' |
75 | 75 | $lastLine = $this->getLastLineNumberThatContains('}', $cleanContent); |
76 | 76 | |
77 | - if($lastLine === false) { |
|
78 | - $this->closeProgressBlock('Could not find the last line, file ' . $routeFilePath . ' may be corrupted.', 'red'); |
|
77 | + if ($lastLine === false) { |
|
78 | + $this->closeProgressBlock('Could not find the last line, file '.$routeFilePath.' may be corrupted.', 'red'); |
|
79 | 79 | return; |
80 | 80 | } |
81 | 81 | |
82 | 82 | // add the code to the line before the last line |
83 | - array_splice($originalContent, $lastLine, 0, ' ' . $code.PHP_EOL); |
|
83 | + array_splice($originalContent, $lastLine, 0, ' '.$code.PHP_EOL); |
|
84 | 84 | |
85 | 85 | // write the new content to the file |
86 | - if(file_put_contents($routeFilePath, implode('', $originalContent)) === false) { |
|
86 | + if (file_put_contents($routeFilePath, implode('', $originalContent)) === false) { |
|
87 | 87 | $this->closeProgressBlock('Failed to add route. Failed writing the modified route file. Maybe check file permissions?', 'red'); |
88 | 88 | return; |
89 | 89 | } |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | |
94 | 94 | private function cleanContentArray(array $content) |
95 | 95 | { |
96 | - return array_filter(array_map(function ($line) { |
|
96 | + return array_filter(array_map(function($line) { |
|
97 | 97 | $lineText = trim($line); |
98 | - if ($lineText === '' || |
|
98 | + if ($lineText === '' || |
|
99 | 99 | $lineText === '\n' || |
100 | 100 | $lineText === '\r' || |
101 | 101 | $lineText === '\r\n' || |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | private function getLastLineNumberThatContains($needle, $haystack) |
127 | 127 | { |
128 | - $matchingLines = array_filter($haystack, function ($k) use ($needle) { |
|
128 | + $matchingLines = array_filter($haystack, function($k) use ($needle) { |
|
129 | 129 | return strpos($k, $needle) !== false; |
130 | 130 | }); |
131 | 131 |
@@ -49,7 +49,7 @@ |
||
49 | 49 | $createRouteFile = $this->confirm('Should we create the file in <fg=blue>'. $routeFilePath . '</> ?', 'yes'); |
50 | 50 | if($createRouteFile) { |
51 | 51 | $this->call('vendor:publish', ['--provider' => \Backpack\CRUD\BackpackServiceProvider::class, '--tag' => 'custom_routes']); |
52 | - }else{ |
|
52 | + } else{ |
|
53 | 53 | $this->error('The route file does not exist. Please create it first.'); |
54 | 54 | } |
55 | 55 |