@@ -249,52 +249,55 @@ public function sortFilesByModuleSequence(array $files)
249
249
/**
250
250
* A wrapping method for any custom logic which needs to be applied to the module list
251
251
*
252
- * @param $modulesPath
253
- * @return array
252
+ * @param array $modulesPath
253
+ * @return string[]
254
254
*/
255
- protected function applyCustomModuleMethods (& $ modulesPath )
255
+ protected function applyCustomModuleMethods ($ modulesPath )
256
256
{
257
- $ this ->removeBlacklistModules ($ modulesPath );
258
- return array_merge ($ modulesPath , $ this ->getCustomModulePaths ());
257
+ $ modulePathsResult = $ this ->removeBlacklistModules ($ modulesPath );
258
+ return array_merge ($ modulePathsResult , $ this ->getCustomModulePaths ());
259
259
}
260
260
261
261
/**
262
262
* Remove blacklist modules from input module paths.
263
263
*
264
- * @param array & $modulePaths
265
- * @return void
264
+ * @param array $modulePaths
265
+ * @return string[]
266
266
*/
267
- protected function removeBlacklistModules (& $ modulePaths )
267
+ private function removeBlacklistModules ($ modulePaths )
268
268
{
269
- foreach ($ modulePaths as $ index => $ modulePath ) {
269
+ $ modulePathsResult = $ modulePaths ;
270
+ foreach ($ modulePathsResult as $ index => $ modulePath ) {
270
271
if (in_array (basename ($ modulePath ), $ this ->getModuleBlacklist ())) {
271
- unset($ modulePaths [$ index ]);
272
+ unset($ modulePathsResult [$ index ]);
272
273
}
273
274
}
275
+
276
+ return $ modulePathsResult ;
274
277
}
275
278
276
279
/**
277
280
* Returns an array of custom module paths defined by the user
278
281
*
279
- * @return array
282
+ * @return string[]
280
283
*/
281
- protected function getCustomModulePaths ()
284
+ private function getCustomModulePaths ()
282
285
{
283
- $ custom_module_paths = getenv (self ::CUSTOM_MODULE_PATHS );
286
+ $ customModulePaths = getenv (self ::CUSTOM_MODULE_PATHS );
284
287
285
- if (!$ custom_module_paths ) {
288
+ if (!$ customModulePaths ) {
286
289
return [];
287
290
}
288
291
289
- return array_map ('trim ' , explode (', ' , $ custom_module_paths ));
292
+ return array_map ('trim ' , explode (', ' , $ customModulePaths ));
290
293
}
291
294
292
295
/**
293
296
* Getter for moduleBlacklist.
294
297
*
295
- * @return array
298
+ * @return string[]
296
299
*/
297
- protected function getModuleBlacklist ()
300
+ private function getModuleBlacklist ()
298
301
{
299
302
return $ this ->moduleBlacklist ;
300
303
}
0 commit comments