@@ -183,7 +183,8 @@ private function applyWithCIServer(int $id): bool
183183 $ result = null ;
184184 }
185185
186- if ($ result === null
186+ if (
187+ $ result === null
187188 || ($ result ->getStatusCode () !== 200
188189 && $ result ->getStatusCode () !== 310 )
189190 ) {
@@ -262,7 +263,8 @@ private function applyWithCIServer(int $id): bool
262263
263264 if (file_exists ($ tempPath . '/ ' . $ file )) {
264265 // Create directories if they don't exist until file
265- if (!file_exists (JPATH_ROOT . '/ ' . $ filePath )
266+ if (
267+ !file_exists (JPATH_ROOT . '/ ' . $ filePath )
266268 || !is_dir (
267269 JPATH_ROOT . '/ ' . $ filePath
268270 )
@@ -323,7 +325,9 @@ private function retrieveGitHubData(GitHub $github, int $id): stdClass
323325 Text::sprintf (
324326 'COM_PATCHTESTER_COULD_NOT_CONNECT_TO_GITHUB ' ,
325327 $ exception ->getMessage ()
326- ), $ exception ->getCode (), $ exception
328+ ),
329+ $ exception ->getCode (),
330+ $ exception
327331 );
328332 }
329333
@@ -349,7 +353,9 @@ private function retrieveGitHubData(GitHub $github, int $id): stdClass
349353 Text::sprintf (
350354 'COM_PATCHTESTER_COULD_NOT_CONNECT_TO_GITHUB ' ,
351355 $ exception ->getMessage ()
352- ), $ exception ->getCode (), $ exception
356+ ),
357+ $ exception ->getCode (),
358+ $ exception
353359 );
354360 }
355361
@@ -384,10 +390,7 @@ private function verifyAutoloader(string $path): bool
384390 array_walk (
385391 $ composerFiles ,
386392 static function ($ composerFile ) use (&$ filesToCheck , $ path ) {
387- if (file_exists (
388- $ path . '/libraries/vendor/composer/ ' . $ composerFile
389- ) === false
390- ) {
393+ if (file_exists ($ path . '/libraries/vendor/composer/ ' . $ composerFile ) === false ) {
391394 return ;
392395 }
393396
@@ -401,20 +404,20 @@ static function ($composerFile) use (&$filesToCheck, $path) {
401404 $ autoload ,
402405 $ match
403406 );
407+
404408 if (!$ resultMatch ) {
405409 return ;
406410 }
407411
408412 // Check if the class is already defined
409- $ autoloadClass = '\Composer\Autoload\ComposerStaticInit '
410- . $ match [ 1 ];
413+ $ autoloadClass = '\Composer\Autoload\ComposerStaticInit ' . $ match [ 1 ];
414+
411415 if (class_exists ($ autoloadClass )) {
412416 return ;
413417 }
414418
415- require_once $ path
416- . '/libraries/vendor/composer/autoload_static.php ' ;
417- // Get all the files
419+ require_once $ path . '/libraries/vendor/composer/autoload_static.php ' ;
420+
418421 $ files = $ autoloadClass ::$ files ;
419422 $ filesToCheck = array_merge ($ filesToCheck , $ files );
420423 } else {
@@ -434,13 +437,14 @@ static function ($composerFile) use (&$filesToCheck, $path) {
434437 * @param array $files The list of files to check
435438 * @param string $path The path where the temporary patch resides
436439 *
437- * @return boolean True if all files exist | False otherwise.
440+ * @return bool True if all files exist | False otherwise.
438441 *
439442 * @since 4.0.0
440443 */
441444 private function checkFilesExist (array $ files , string $ path ): bool
442445 {
443446 $ path = Path::clean ($ path );
447+
444448 foreach ($ files as $ file ) {
445449 if (is_array ($ file )) {
446450 $ this ->checkFilesExist ($ file , $ path );
0 commit comments