This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace App\Http\Controllers; |
||
4 | |||
5 | use Validator; |
||
6 | use Illuminate\Http\Request; |
||
7 | use Illuminate\Routing\Redirector; |
||
8 | use Illuminate\Support\Facades\Artisan; |
||
9 | use App\Http\Requests; |
||
10 | use App\Http\Helpers\Installer\DatabaseManager; |
||
11 | use App\Http\Helpers\Installer\EnvironmentManager; |
||
12 | use App\Http\Helpers\Installer\PermissionsChecker; |
||
13 | use App\Http\Helpers\Installer\RequirementsChecker; |
||
14 | use App\Http\Helpers\Installer\InstalledFileManager; |
||
15 | |||
16 | class InstallerController extends Controller |
||
17 | { |
||
18 | /** |
||
19 | * Create a new controller instance. |
||
20 | * |
||
21 | * @return void |
||
0 ignored issues
–
show
|
|||
22 | */ |
||
23 | public function __construct() |
||
24 | { |
||
25 | $this->middleware('canInstall'); |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * Display the installer welcome page. |
||
30 | * |
||
31 | * @return \Illuminate\View\View |
||
32 | */ |
||
33 | public function stepWelcome() |
||
34 | { |
||
35 | return view('installer.welcome'); |
||
0 ignored issues
–
show
The expression
view('installer.welcome'); of type Illuminate\View\View|Ill...\Contracts\View\Factory adds the type Illuminate\Contracts\View\Factory to the return on line 35 which is incompatible with the return type documented by App\Http\Controllers\Ins...Controller::stepWelcome of type Illuminate\View\View .
![]() |
|||
36 | } |
||
37 | |||
38 | /** |
||
39 | * XXXXXXXXXX |
||
40 | * |
||
41 | * @return \Illuminate\View\View |
||
42 | */ |
||
43 | public function stepApplication() |
||
44 | { |
||
45 | return view('installer.application'); |
||
0 ignored issues
–
show
The expression
view('installer.application'); of type Illuminate\View\View|Ill...\Contracts\View\Factory adds the type Illuminate\Contracts\View\Factory to the return on line 45 which is incompatible with the return type documented by App\Http\Controllers\Ins...roller::stepApplication of type Illuminate\View\View .
![]() |
|||
46 | } |
||
47 | |||
48 | /** |
||
49 | * XXXXXXXXXX |
||
50 | * |
||
51 | * @return \Illuminate\View\View |
||
52 | */ |
||
53 | public function stepStoreApp(Request $request, Redirector $redirect) |
||
54 | { |
||
55 | session([ |
||
56 | 'APP_URL' => $request->url, |
||
57 | 'APP_LOCALE' => $request->locale, |
||
58 | 'APP_ENV' => $request->env, |
||
59 | 'APP_KEY' => env('APP_KEY') |
||
60 | ]); |
||
61 | |||
62 | return $redirect->route('KleisInstaller::stepDatabase'); |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * XXXXXXXXXX |
||
67 | * |
||
68 | * @return \Illuminate\View\View |
||
69 | */ |
||
70 | public function stepDatabase() |
||
71 | { |
||
72 | return view('installer.database'); |
||
0 ignored issues
–
show
The expression
view('installer.database'); of type Illuminate\View\View|Ill...\Contracts\View\Factory adds the type Illuminate\Contracts\View\Factory to the return on line 72 which is incompatible with the return type documented by App\Http\Controllers\Ins...ontroller::stepDatabase of type Illuminate\View\View .
![]() |
|||
73 | } |
||
74 | |||
75 | /** |
||
76 | * XXXXXXXXXX |
||
77 | * |
||
78 | * @return \Illuminate\View\View |
||
79 | */ |
||
80 | public function stepStoreDb(Request $request, Redirector $redirect) |
||
81 | { |
||
82 | session([ |
||
83 | 'DB_CONNECTION' => $request->dbtype, |
||
84 | 'DB_HOST' => $request->dbhost, |
||
85 | 'DB_PORT' => $request->dbport, |
||
86 | 'DB_DATABASE' => $request->dbname, |
||
87 | 'DB_USERNAME' => $request->dbuser, |
||
88 | 'DB_PASSWORD' => $request->dbpassword |
||
89 | ]); |
||
90 | |||
91 | return $redirect->route('KleisInstaller::stepCustomization'); |
||
92 | } |
||
93 | |||
94 | /** |
||
95 | * XXXXXXXXXX |
||
96 | * |
||
97 | * @return \Illuminate\View\View |
||
98 | */ |
||
99 | public function stepCustomization(Request $request) |
||
100 | { |
||
101 | $request->session()->forget('KLEIS_LOGO'); |
||
0 ignored issues
–
show
The method
forget() does not seem to exist on object<Symfony\Component...ssion\SessionInterface> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
102 | $request->session()->forget('KLEIS_ANNOUNCE'); |
||
0 ignored issues
–
show
The method
forget() does not seem to exist on object<Symfony\Component...ssion\SessionInterface> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
103 | |||
104 | return view('installer.customization'); |
||
0 ignored issues
–
show
The expression
view('installer.customization'); of type Illuminate\View\View|Ill...\Contracts\View\Factory adds the type Illuminate\Contracts\View\Factory to the return on line 104 which is incompatible with the return type documented by App\Http\Controllers\Ins...ller::stepCustomization of type Illuminate\View\View .
![]() |
|||
105 | } |
||
106 | |||
107 | /** |
||
108 | * XXXXXXXXXX |
||
109 | * |
||
110 | * @return \Illuminate\View\View |
||
111 | */ |
||
112 | public function stepStoreCusto(Request $request, Redirector $redirect) |
||
113 | { |
||
114 | $validator = Validator::make($request->all(), [ |
||
115 | 'logo' => 'image|mimes:jpeg,png|dimensions:max_height:200', |
||
116 | ]); |
||
117 | |||
118 | if ($validator->fails()) { |
||
119 | return $redirect->route('KleisInstaller::stepCustomization') |
||
120 | ->withErrors($validator) |
||
121 | ->withInput(); |
||
122 | } |
||
123 | |||
124 | if ($request->hasFile('logo')) { |
||
125 | if ($request->file('logo')->isValid()) { |
||
126 | $ext = $request->logo->guessClientExtension(); |
||
127 | $filename = "logo.{$ext}"; |
||
128 | $request->logo->move('images', $filename); |
||
129 | session(['KLEIS_LOGO' => $filename]); |
||
130 | } |
||
131 | } |
||
132 | |||
133 | if(!empty($request->announce)) { |
||
134 | $filename = 'announce.md'; |
||
135 | $mdfile = public_path("markdown/{$filename}"); |
||
136 | try { |
||
137 | file_put_contents($mdfile, $request->announce); |
||
138 | } catch(Exception $e) { |
||
0 ignored issues
–
show
The class
App\Http\Controllers\Exception does not exist. Did you forget a USE statement, or did you not list all dependencies?
Scrutinizer analyzes your It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis. ![]() |
|||
139 | return $redirect->route('KleisInstaller::stepCustomization') |
||
0 ignored issues
–
show
The return type of
return $redirect->route(...ization')->withInput(); (Illuminate\Http\RedirectResponse ) is incompatible with the return type documented by App\Http\Controllers\Ins...troller::stepStoreCusto of type Illuminate\View\View .
If you return a value from a function or method, it should be a sub-type of the type that is given by the parent type f.e. an interface, or abstract method. This is more formally defined by the Lizkov substitution principle, and guarantees that classes that depend on the parent type can use any instance of a child type interchangably. This principle also belongs to the SOLID principles for object oriented design. Let’s take a look at an example: class Author {
private $name;
public function __construct($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
abstract class Post {
public function getAuthor() {
return 'Johannes';
}
}
class BlogPost extends Post {
public function getAuthor() {
return new Author('Johannes');
}
}
class ForumPost extends Post { /* ... */ }
function my_function(Post $post) {
echo strtoupper($post->getAuthor());
}
Our function ![]() |
|||
140 | ->withInput(); |
||
141 | } |
||
142 | session(['KLEIS_ANNOUNCE' => $filename]); |
||
143 | } |
||
144 | |||
145 | return $redirect->route('KleisInstaller::stepEnvironment'); |
||
0 ignored issues
–
show
The return type of
return $redirect->route(...ler::stepEnvironment'); (Illuminate\Http\RedirectResponse ) is incompatible with the return type documented by App\Http\Controllers\Ins...troller::stepStoreCusto of type Illuminate\View\View .
If you return a value from a function or method, it should be a sub-type of the type that is given by the parent type f.e. an interface, or abstract method. This is more formally defined by the Lizkov substitution principle, and guarantees that classes that depend on the parent type can use any instance of a child type interchangably. This principle also belongs to the SOLID principles for object oriented design. Let’s take a look at an example: class Author {
private $name;
public function __construct($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
abstract class Post {
public function getAuthor() {
return 'Johannes';
}
}
class BlogPost extends Post {
public function getAuthor() {
return new Author('Johannes');
}
}
class ForumPost extends Post { /* ... */ }
function my_function(Post $post) {
echo strtoupper($post->getAuthor());
}
Our function ![]() |
|||
146 | } |
||
147 | |||
148 | |||
149 | /** |
||
150 | * XXXXXXXXXX |
||
151 | * |
||
152 | * @return \Illuminate\View\View |
||
153 | */ |
||
154 | public function stepEnvironment(EnvironmentManager $environmentManager, Request $request) |
||
155 | { |
||
156 | $envConfig = $environmentManager->getEnvContent($request); |
||
157 | |||
158 | return view('installer.environment', compact('envConfig')); |
||
0 ignored issues
–
show
The expression
view('installer.environm... compact('envConfig')); of type Illuminate\View\View|Ill...\Contracts\View\Factory adds the type Illuminate\Contracts\View\Factory to the return on line 158 which is incompatible with the return type documented by App\Http\Controllers\Ins...roller::stepEnvironment of type Illuminate\View\View .
![]() |
|||
159 | } |
||
160 | |||
161 | /** |
||
162 | * Processes the newly saved environment configuration and continue. |
||
163 | * |
||
164 | * @param Request $input |
||
0 ignored issues
–
show
There is no parameter named
$input . Was it maybe removed?
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. Consider the following example. The parameter /**
* @param array $germany
* @param array $island
* @param array $italy
*/
function finale($germany, $island) {
return "2:1";
}
The most likely cause is that the parameter was removed, but the annotation was not. ![]() |
|||
165 | * @param Redirector $redirect |
||
166 | * @return \Illuminate\Http\RedirectResponse |
||
167 | */ |
||
168 | public function stepSaveEnv(EnvironmentManager $environmentManager, Request $request, Redirector $redirect) |
||
169 | { |
||
170 | $status = $environmentManager->saveFile($request); |
||
171 | |||
172 | if($status) { |
||
173 | return $redirect->route('KleisInstaller::stepRequirements') |
||
174 | ->with(['message' => session('message')]); |
||
175 | } else { |
||
176 | return $redirect->route('KleisInstaller::stepEnvironment') |
||
177 | ->with(['message' => session('message')]); |
||
178 | } |
||
179 | } |
||
180 | |||
181 | /** |
||
182 | * Display the permissions check page. |
||
183 | * |
||
184 | * @return \Illuminate\View\View |
||
185 | */ |
||
186 | public function stepPermissions(PermissionsChecker $checker) |
||
187 | { |
||
188 | $permissions = $checker->check(config('installer.permissions')); |
||
189 | |||
190 | return view('installer.permissions', compact('permissions')); |
||
0 ignored issues
–
show
The expression
view('installer.permissi...ompact('permissions')); of type Illuminate\View\View|Ill...\Contracts\View\Factory adds the type Illuminate\Contracts\View\Factory to the return on line 190 which is incompatible with the return type documented by App\Http\Controllers\Ins...roller::stepPermissions of type Illuminate\View\View .
![]() |
|||
191 | } |
||
192 | |||
193 | /** |
||
194 | * Display the requirements page. |
||
195 | * |
||
196 | * @return \Illuminate\View\View |
||
197 | */ |
||
198 | public function stepRequirements(RequirementsChecker $checker) |
||
199 | { |
||
200 | $requirements = $checker->check(config('installer.requirements')); |
||
201 | |||
202 | return view('installer.requirements', compact('requirements')); |
||
0 ignored issues
–
show
The expression
view('installer.requirem...mpact('requirements')); of type Illuminate\View\View|Ill...\Contracts\View\Factory adds the type Illuminate\Contracts\View\Factory to the return on line 202 which is incompatible with the return type documented by App\Http\Controllers\Ins...oller::stepRequirements of type Illuminate\View\View .
![]() |
|||
203 | } |
||
204 | |||
205 | /** |
||
206 | * XXXXXXXXXX |
||
207 | * |
||
208 | * @return \Illuminate\View\View |
||
209 | */ |
||
210 | public function stepMigrate(DatabaseManager $databaseManager) |
||
211 | { |
||
212 | $response = $databaseManager->migrateAndSeed(); |
||
213 | |||
214 | return redirect()->route('KleisInstaller::stepFinal') |
||
215 | ->with(['message' => $response]); |
||
216 | } |
||
217 | |||
218 | /** |
||
219 | * Update installed file and display finished view. |
||
220 | * |
||
221 | * @param InstalledFileManager $fileManager |
||
222 | * @return \Illuminate\View\View |
||
223 | */ |
||
224 | public function stepFinish(InstalledFileManager $fileManager) |
||
225 | { |
||
226 | $fileManager->update(); |
||
227 | |||
228 | return view('installer.finished'); |
||
0 ignored issues
–
show
The expression
view('installer.finished'); of type Illuminate\View\View|Ill...\Contracts\View\Factory adds the type Illuminate\Contracts\View\Factory to the return on line 228 which is incompatible with the return type documented by App\Http\Controllers\Ins...rController::stepFinish of type Illuminate\View\View .
![]() |
|||
229 | } |
||
230 | } |
||
231 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.