@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | 'c', |
65 | 65 | InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, |
66 | 66 | 'enable the specified checker(s)', |
67 | - [ 'private', 'deprecation', 'strong-comparison' ] |
|
67 | + ['private', 'deprecation', 'strong-comparison'] |
|
68 | 68 | ) |
69 | 69 | ->addOption( |
70 | 70 | '--skip-checkers', |
@@ -94,12 +94,12 @@ discard block |
||
94 | 94 | |
95 | 95 | $codeChecker = new CodeChecker($checkList, !$input->getOption('skip-validate-info')); |
96 | 96 | |
97 | - $codeChecker->listen('CodeChecker', 'analyseFileBegin', function ($params) use ($output) { |
|
97 | + $codeChecker->listen('CodeChecker', 'analyseFileBegin', function($params) use ($output) { |
|
98 | 98 | if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { |
99 | 99 | $output->writeln("<info>Analysing {$params}</info>"); |
100 | 100 | } |
101 | 101 | }); |
102 | - $codeChecker->listen('CodeChecker', 'analyseFileFinished', function ($filename, $errors) use ($output) { |
|
102 | + $codeChecker->listen('CodeChecker', 'analyseFileFinished', function($filename, $errors) use ($output) { |
|
103 | 103 | $count = count($errors); |
104 | 104 | |
105 | 105 | // show filename if the verbosity is low, but there are errors in a file |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | if ($count > 0 || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { |
112 | 112 | $output->writeln(" {$count} errors"); |
113 | 113 | } |
114 | - usort($errors, function ($a, $b) { |
|
114 | + usort($errors, function($a, $b) { |
|
115 | 115 | return $a['line'] > $b['line']; |
116 | 116 | }); |
117 | 117 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | |
128 | 128 | if (!$input->getOption('skip-validate-info')) { |
129 | 129 | $infoChecker = new InfoChecker(); |
130 | - $infoChecker->listen('InfoChecker', 'parseError', function ($error) use ($output) { |
|
130 | + $infoChecker->listen('InfoChecker', 'parseError', function($error) use ($output) { |
|
131 | 131 | $output->writeln("<error>Invalid appinfo.xml file found: $error</error>"); |
132 | 132 | }); |
133 | 133 |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $coordinator = \OC::$server->query(Coordinator::class); |
163 | 163 | $isBootable = $coordinator->isBootable($app); |
164 | 164 | |
165 | - $hasAppPhpFile = is_file($appPath . '/appinfo/app.php'); |
|
165 | + $hasAppPhpFile = is_file($appPath.'/appinfo/app.php'); |
|
166 | 166 | |
167 | 167 | if ($isBootable && $hasAppPhpFile) { |
168 | 168 | \OC::$server->getLogger()->error('/appinfo/app.php is not loaded when \OCP\AppFramework\Bootstrap\IBootstrap on the application class is used. Migrate everything from app.php to the Application class.', [ |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | \OC::$server->getLogger()->debug('/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.', [ |
173 | 173 | 'app' => $app, |
174 | 174 | ]); |
175 | - \OC::$server->getEventLogger()->start('load_app_' . $app, 'Load app: ' . $app); |
|
175 | + \OC::$server->getEventLogger()->start('load_app_'.$app, 'Load app: '.$app); |
|
176 | 176 | try { |
177 | 177 | self::requireAppFile($app); |
178 | 178 | } catch (Throwable $ex) { |
@@ -181,18 +181,18 @@ discard block |
||
181 | 181 | } |
182 | 182 | if (!\OC::$server->getAppManager()->isShipped($app) && !self::isType($app, ['authentication'])) { |
183 | 183 | \OC::$server->getLogger()->logException($ex, [ |
184 | - 'message' => "App $app threw an error during app.php load and will be disabled: " . $ex->getMessage(), |
|
184 | + 'message' => "App $app threw an error during app.php load and will be disabled: ".$ex->getMessage(), |
|
185 | 185 | ]); |
186 | 186 | |
187 | 187 | // Only disable apps which are not shipped and that are not authentication apps |
188 | 188 | \OC::$server->getAppManager()->disableApp($app, true); |
189 | 189 | } else { |
190 | 190 | \OC::$server->getLogger()->logException($ex, [ |
191 | - 'message' => "App $app threw an error during app.php load: " . $ex->getMessage(), |
|
191 | + 'message' => "App $app threw an error during app.php load: ".$ex->getMessage(), |
|
192 | 192 | ]); |
193 | 193 | } |
194 | 194 | } |
195 | - \OC::$server->getEventLogger()->end('load_app_' . $app); |
|
195 | + \OC::$server->getEventLogger()->end('load_app_'.$app); |
|
196 | 196 | } |
197 | 197 | $coordinator->bootApp($app); |
198 | 198 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | * @param bool $force |
260 | 260 | */ |
261 | 261 | public static function registerAutoloading(string $app, string $path, bool $force = false) { |
262 | - $key = $app . '-' . $path; |
|
262 | + $key = $app.'-'.$path; |
|
263 | 263 | if (!$force && isset(self::$alreadyRegistered[$key])) { |
264 | 264 | return; |
265 | 265 | } |
@@ -270,17 +270,17 @@ discard block |
||
270 | 270 | $appNamespace = \OC\AppFramework\App::buildAppNamespace($app); |
271 | 271 | \OC::$server->registerNamespace($app, $appNamespace); |
272 | 272 | |
273 | - if (file_exists($path . '/composer/autoload.php')) { |
|
274 | - require_once $path . '/composer/autoload.php'; |
|
273 | + if (file_exists($path.'/composer/autoload.php')) { |
|
274 | + require_once $path.'/composer/autoload.php'; |
|
275 | 275 | } else { |
276 | - \OC::$composerAutoloader->addPsr4($appNamespace . '\\', $path . '/lib/', true); |
|
276 | + \OC::$composerAutoloader->addPsr4($appNamespace.'\\', $path.'/lib/', true); |
|
277 | 277 | // Register on legacy autoloader |
278 | 278 | \OC::$loader->addValidRoot($path); |
279 | 279 | } |
280 | 280 | |
281 | 281 | // Register Test namespace only when testing |
282 | 282 | if (defined('PHPUNIT_RUN') || defined('CLI_TEST_RUN')) { |
283 | - \OC::$composerAutoloader->addPsr4($appNamespace . '\\Tests\\', $path . '/tests/', true); |
|
283 | + \OC::$composerAutoloader->addPsr4($appNamespace.'\\Tests\\', $path.'/tests/', true); |
|
284 | 284 | } |
285 | 285 | } |
286 | 286 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | */ |
293 | 293 | private static function requireAppFile(string $app) { |
294 | 294 | // encapsulated here to avoid variable scope conflicts |
295 | - require_once $app . '/appinfo/app.php'; |
|
295 | + require_once $app.'/appinfo/app.php'; |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | /** |
@@ -385,8 +385,8 @@ discard block |
||
385 | 385 | } else { |
386 | 386 | $apps = $appManager->getEnabledAppsForUser($user); |
387 | 387 | } |
388 | - $apps = array_filter($apps, function ($app) { |
|
389 | - return $app !== 'files';//we add this manually |
|
388 | + $apps = array_filter($apps, function($app) { |
|
389 | + return $app !== 'files'; //we add this manually |
|
390 | 390 | }); |
391 | 391 | sort($apps); |
392 | 392 | array_unshift($apps, 'files'); |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | |
487 | 487 | $possibleApps = []; |
488 | 488 | foreach (OC::$APPSROOTS as $dir) { |
489 | - if (file_exists($dir['path'] . '/' . $appId)) { |
|
489 | + if (file_exists($dir['path'].'/'.$appId)) { |
|
490 | 490 | $possibleApps[] = $dir; |
491 | 491 | } |
492 | 492 | } |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | } else { |
501 | 501 | $versionToLoad = []; |
502 | 502 | foreach ($possibleApps as $possibleApp) { |
503 | - $version = self::getAppVersionByPath($possibleApp['path'] . '/' . $appId); |
|
503 | + $version = self::getAppVersionByPath($possibleApp['path'].'/'.$appId); |
|
504 | 504 | if (empty($versionToLoad) || version_compare($version, $versionToLoad['version'], '>')) { |
505 | 505 | $versionToLoad = [ |
506 | 506 | 'dir' => $possibleApp, |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | } |
531 | 531 | |
532 | 532 | if (($dir = self::findAppInDirectories($appId)) != false) { |
533 | - return $dir['path'] . '/' . $appId; |
|
533 | + return $dir['path'].'/'.$appId; |
|
534 | 534 | } |
535 | 535 | return false; |
536 | 536 | } |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | */ |
546 | 546 | public static function getAppWebPath(string $appId) { |
547 | 547 | if (($dir = self::findAppInDirectories($appId)) != false) { |
548 | - return OC::$WEBROOT . $dir['url'] . '/' . $appId; |
|
548 | + return OC::$WEBROOT.$dir['url'].'/'.$appId; |
|
549 | 549 | } |
550 | 550 | return false; |
551 | 551 | } |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | * @return string |
570 | 570 | */ |
571 | 571 | public static function getAppVersionByPath(string $path): string { |
572 | - $infoFile = $path . '/appinfo/info.xml'; |
|
572 | + $infoFile = $path.'/appinfo/info.xml'; |
|
573 | 573 | $appData = \OC::$server->getAppManager()->getAppInfo($infoFile, true); |
574 | 574 | return isset($appData['version']) ? $appData['version'] : ''; |
575 | 575 | } |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | * @param string $page |
670 | 670 | */ |
671 | 671 | public static function registerAdmin(string $app, string $page) { |
672 | - self::$adminForms[] = $app . '/' . $page . '.php'; |
|
672 | + self::$adminForms[] = $app.'/'.$page.'.php'; |
|
673 | 673 | } |
674 | 674 | |
675 | 675 | /** |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | * @param string $page |
679 | 679 | */ |
680 | 680 | public static function registerPersonal(string $app, string $page) { |
681 | - self::$personalForms[] = $app . '/' . $page . '.php'; |
|
681 | + self::$personalForms[] = $app.'/'.$page.'.php'; |
|
682 | 682 | } |
683 | 683 | |
684 | 684 | /** |
@@ -749,14 +749,14 @@ discard block |
||
749 | 749 | |
750 | 750 | foreach (OC::$APPSROOTS as $apps_dir) { |
751 | 751 | if (!is_readable($apps_dir['path'])) { |
752 | - \OCP\Util::writeLog('core', 'unable to read app folder : ' . $apps_dir['path'], ILogger::WARN); |
|
752 | + \OCP\Util::writeLog('core', 'unable to read app folder : '.$apps_dir['path'], ILogger::WARN); |
|
753 | 753 | continue; |
754 | 754 | } |
755 | 755 | $dh = opendir($apps_dir['path']); |
756 | 756 | |
757 | 757 | if (is_resource($dh)) { |
758 | 758 | while (($file = readdir($dh)) !== false) { |
759 | - if ($file[0] != '.' and is_dir($apps_dir['path'] . '/' . $file) and is_file($apps_dir['path'] . '/' . $file . '/appinfo/info.xml')) { |
|
759 | + if ($file[0] != '.' and is_dir($apps_dir['path'].'/'.$file) and is_file($apps_dir['path'].'/'.$file.'/appinfo/info.xml')) { |
|
760 | 760 | $apps[] = $file; |
761 | 761 | } |
762 | 762 | } |
@@ -790,12 +790,12 @@ discard block |
||
790 | 790 | if (array_search($app, $blacklist) === false) { |
791 | 791 | $info = OC_App::getAppInfo($app, false, $langCode); |
792 | 792 | if (!is_array($info)) { |
793 | - \OCP\Util::writeLog('core', 'Could not read app info file for app "' . $app . '"', ILogger::ERROR); |
|
793 | + \OCP\Util::writeLog('core', 'Could not read app info file for app "'.$app.'"', ILogger::ERROR); |
|
794 | 794 | continue; |
795 | 795 | } |
796 | 796 | |
797 | 797 | if (!isset($info['name'])) { |
798 | - \OCP\Util::writeLog('core', 'App id "' . $app . '" has no name in appinfo', ILogger::ERROR); |
|
798 | + \OCP\Util::writeLog('core', 'App id "'.$app.'" has no name in appinfo', ILogger::ERROR); |
|
799 | 799 | continue; |
800 | 800 | } |
801 | 801 | |
@@ -827,12 +827,12 @@ discard block |
||
827 | 827 | |
828 | 828 | $appPath = self::getAppPath($app); |
829 | 829 | if ($appPath !== false) { |
830 | - $appIcon = $appPath . '/img/' . $app . '.svg'; |
|
830 | + $appIcon = $appPath.'/img/'.$app.'.svg'; |
|
831 | 831 | if (file_exists($appIcon)) { |
832 | - $info['preview'] = $urlGenerator->imagePath($app, $app . '.svg'); |
|
832 | + $info['preview'] = $urlGenerator->imagePath($app, $app.'.svg'); |
|
833 | 833 | $info['previewAsIcon'] = true; |
834 | 834 | } else { |
835 | - $appIcon = $appPath . '/img/app.svg'; |
|
835 | + $appIcon = $appPath.'/img/app.svg'; |
|
836 | 836 | if (file_exists($appIcon)) { |
837 | 837 | $info['preview'] = $urlGenerator->imagePath($app, 'app.svg'); |
838 | 838 | $info['previewAsIcon'] = true; |
@@ -977,8 +977,8 @@ discard block |
||
977 | 977 | self::registerAutoloading($appId, $appPath, true); |
978 | 978 | self::executeRepairSteps($appId, $appData['repair-steps']['pre-migration']); |
979 | 979 | |
980 | - if (file_exists($appPath . '/appinfo/database.xml')) { |
|
981 | - OC_DB::updateDbFromStructure($appPath . '/appinfo/database.xml'); |
|
980 | + if (file_exists($appPath.'/appinfo/database.xml')) { |
|
981 | + OC_DB::updateDbFromStructure($appPath.'/appinfo/database.xml'); |
|
982 | 982 | } else { |
983 | 983 | $ms = new MigrationService($appId, \OC::$server->getDatabaseConnection()); |
984 | 984 | $ms->migrate(); |
@@ -999,10 +999,10 @@ discard block |
||
999 | 999 | \OC::$server->getConfig()->deleteAppValue($appId, 'ocsid'); |
1000 | 1000 | } |
1001 | 1001 | foreach ($appData['remote'] as $name => $path) { |
1002 | - \OC::$server->getConfig()->setAppValue('core', 'remote_' . $name, $appId . '/' . $path); |
|
1002 | + \OC::$server->getConfig()->setAppValue('core', 'remote_'.$name, $appId.'/'.$path); |
|
1003 | 1003 | } |
1004 | 1004 | foreach ($appData['public'] as $name => $path) { |
1005 | - \OC::$server->getConfig()->setAppValue('core', 'public_' . $name, $appId . '/' . $path); |
|
1005 | + \OC::$server->getConfig()->setAppValue('core', 'public_'.$name, $appId.'/'.$path); |
|
1006 | 1006 | } |
1007 | 1007 | |
1008 | 1008 | self::setAppTypes($appId); |
@@ -1072,17 +1072,17 @@ discard block |
||
1072 | 1072 | public static function getStorage(string $appId) { |
1073 | 1073 | if (\OC::$server->getAppManager()->isEnabledForUser($appId)) { //sanity check |
1074 | 1074 | if (\OC::$server->getUserSession()->isLoggedIn()) { |
1075 | - $view = new \OC\Files\View('/' . OC_User::getUser()); |
|
1075 | + $view = new \OC\Files\View('/'.OC_User::getUser()); |
|
1076 | 1076 | if (!$view->file_exists($appId)) { |
1077 | 1077 | $view->mkdir($appId); |
1078 | 1078 | } |
1079 | - return new \OC\Files\View('/' . OC_User::getUser() . '/' . $appId); |
|
1079 | + return new \OC\Files\View('/'.OC_User::getUser().'/'.$appId); |
|
1080 | 1080 | } else { |
1081 | - \OCP\Util::writeLog('core', 'Can\'t get app storage, app ' . $appId . ', user not logged in', ILogger::ERROR); |
|
1081 | + \OCP\Util::writeLog('core', 'Can\'t get app storage, app '.$appId.', user not logged in', ILogger::ERROR); |
|
1082 | 1082 | return false; |
1083 | 1083 | } |
1084 | 1084 | } else { |
1085 | - \OCP\Util::writeLog('core', 'Can\'t get app storage, app ' . $appId . ' not enabled', ILogger::ERROR); |
|
1085 | + \OCP\Util::writeLog('core', 'Can\'t get app storage, app '.$appId.' not enabled', ILogger::ERROR); |
|
1086 | 1086 | return false; |
1087 | 1087 | } |
1088 | 1088 | } |
@@ -1119,7 +1119,7 @@ discard block |
||
1119 | 1119 | |
1120 | 1120 | if ($attributeLang === $similarLang) { |
1121 | 1121 | $similarLangFallback = $option['@value']; |
1122 | - } elseif (strpos($attributeLang, $similarLang . '_') === 0) { |
|
1122 | + } elseif (strpos($attributeLang, $similarLang.'_') === 0) { |
|
1123 | 1123 | if ($similarLangFallback === false) { |
1124 | 1124 | $similarLangFallback = $option['@value']; |
1125 | 1125 | } |