@@ -10,7 +10,7 @@ |
||
| 10 | 10 | * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -return array ( |
|
| 13 | +return array( |
|
| 14 | 14 | |
| 15 | 15 | 'Translation Tool' => 'Outil de traduction', |
| 16 | 16 | 'Manage webtrees translation.' => 'Gère les traductions de webtrees', |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | $locale->languageTag() |
| 71 | 71 | ); |
| 72 | 72 | |
| 73 | - return $this->viewResponse($this->module->name() . '::status', [ |
|
| 73 | + return $this->viewResponse($this->module->name().'::status', [ |
|
| 74 | 74 | 'title' => $this->module->title(), |
| 75 | 75 | 'language' => $locale->endonym(), |
| 76 | 76 | 'source_code_paths' => $sourceCodePaths->flatten()->sort(), |
@@ -71,10 +71,10 @@ |
||
| 71 | 71 | */ |
| 72 | 72 | public function loadRoutes(Map $router): void |
| 73 | 73 | { |
| 74 | - $router->attach('', '', static function (Map $router): void { |
|
| 74 | + $router->attach('', '', static function(Map $router): void { |
|
| 75 | 75 | |
| 76 | 76 | |
| 77 | - $router->attach('', '/module-maj/translationtool', static function (Map $router): void { |
|
| 77 | + $router->attach('', '/module-maj/translationtool', static function(Map $router): void { |
|
| 78 | 78 | |
| 79 | 79 | $router->extras([ |
| 80 | 80 | 'middleware' => [ |
@@ -91,11 +91,11 @@ |
||
| 91 | 91 | $key = $translation->getOriginal(); |
| 92 | 92 | $translation_plural = $translation->getPlural(); |
| 93 | 93 | if ($translation_plural !== null && strlen($translation_plural) > 0) { |
| 94 | - $key .= I18N::PLURAL . $translation_plural; |
|
| 94 | + $key .= I18N::PLURAL.$translation_plural; |
|
| 95 | 95 | } |
| 96 | 96 | $translation_context = $translation->getContext(); |
| 97 | 97 | if ($translation_context !== null && strlen($translation_context) > 0) { |
| 98 | - $key = $translation_context . I18N::CONTEXT . $key; |
|
| 98 | + $key = $translation_context.I18N::CONTEXT.$key; |
|
| 99 | 99 | } |
| 100 | 100 | return $key; |
| 101 | 101 | } |
@@ -59,12 +59,12 @@ discard block |
||
| 59 | 59 | public function listMyArtJaubPackagesPaths(): array |
| 60 | 60 | { |
| 61 | 61 | if (getenv('HOME') === false) { |
| 62 | - putenv('HOME=' . Webtrees::DATA_DIR); |
|
| 62 | + putenv('HOME='.Webtrees::DATA_DIR); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | $maj_packages = []; |
| 66 | 66 | try { |
| 67 | - $composer = Factory::create(new NullIO(), Webtrees::ROOT_DIR . 'composer.json'); |
|
| 67 | + $composer = Factory::create(new NullIO(), Webtrees::ROOT_DIR.'composer.json'); |
|
| 68 | 68 | |
| 69 | 69 | $packages = $composer->getRepositoryManager() |
| 70 | 70 | ->getLocalRepository() |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | } |
| 78 | 78 | } catch (Exception $ex) { |
| 79 | 79 | FlashMessages::addMessage( |
| 80 | - I18N::translate('No composer.json file could be loaded, some translations may be missing.') . '<br>' . |
|
| 80 | + I18N::translate('No composer.json file could be loaded, some translations may be missing.').'<br>'. |
|
| 81 | 81 | I18N::translate('This is expected when not running from a development instance.'), |
| 82 | 82 | 'warning' |
| 83 | 83 | ); |
@@ -108,8 +108,7 @@ discard block |
||
| 108 | 108 | [$package] |
| 109 | 109 | ); |
| 110 | 110 | array_shift($package_map); |
| 111 | - $autoloads = count($package_map) == 0 ? ['psr-4' => []] : |
|
| 112 | - $autoload_generator->parseAutoloads($package_map, $composer->getPackage()); |
|
| 111 | + $autoloads = count($package_map) == 0 ? ['psr-4' => []] : $autoload_generator->parseAutoloads($package_map, $composer->getPackage()); |
|
| 113 | 112 | $psr4_paths = []; |
| 114 | 113 | foreach ($autoloads['psr-4'] as $psr4_ns_paths) { |
| 115 | 114 | foreach ($psr4_ns_paths as $psr4_ns_path) { |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | public function sourceCodePaths(): Collection |
| 60 | 60 | { |
| 61 | 61 | $paths = app(ModuleService::class)->findByInterface(ModuleMyArtJaubInterface::class) |
| 62 | - ->mapWithKeys(function (ModuleMyArtJaubInterface $module): array { |
|
| 62 | + ->mapWithKeys(function(ModuleMyArtJaubInterface $module): array { |
|
| 63 | 63 | return [$module->name() => [realpath($module->resourcesFolder())]]; |
| 64 | 64 | }); |
| 65 | 65 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | foreach ($maj_packages as list($maj_package, $psr4_paths)) { |
| 69 | 69 | /** @var PackageInterface $maj_package */ |
| 70 | 70 | $installer_name = $maj_package->getExtra()['installer-name'] ?? ''; |
| 71 | - $key = $installer_name === '' ? $maj_package->getName() : '_' . $installer_name . '_'; |
|
| 71 | + $key = $installer_name === '' ? $maj_package->getName() : '_'.$installer_name.'_'; |
|
| 72 | 72 | if (count($psr4_paths) > 0) { |
| 73 | 73 | $paths->put($key, array_merge($paths->get($key, []), $psr4_paths)); |
| 74 | 74 | } |
@@ -92,8 +92,8 @@ discard block |
||
| 92 | 92 | foreach ($source_code_paths as $package => $paths) { |
| 93 | 93 | $php_files = array(); |
| 94 | 94 | foreach ($paths as $path) { |
| 95 | - $php_files = [...$php_files, ...$this->glob_recursive($path . '/*.php')]; |
|
| 96 | - $php_files = [...$php_files, ...$this->glob_recursive($path . '/*.phtml')]; |
|
| 95 | + $php_files = [...$php_files, ...$this->glob_recursive($path.'/*.php')]; |
|
| 96 | + $php_files = [...$php_files, ...$this->glob_recursive($path.'/*.phtml')]; |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | $php_scanner = new PhpScanner(Translations::create($package)); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | public function listMyArtJaubTranslations(string $language): Collection |
| 128 | 128 | { |
| 129 | 129 | return app(ModuleService::class)->findByInterface(ModuleMyArtJaubInterface::class) |
| 130 | - ->mapWithKeys(function (ModuleMyArtJaubInterface $module) use ($language): array { |
|
| 130 | + ->mapWithKeys(function(ModuleMyArtJaubInterface $module) use ($language): array { |
|
| 131 | 131 | return [$module->name() => $module->customTranslations($language)]; |
| 132 | 132 | }); |
| 133 | 133 | } |
@@ -144,10 +144,10 @@ discard block |
||
| 144 | 144 | protected function glob_recursive(string $pattern, int $flags = 0): array |
| 145 | 145 | { |
| 146 | 146 | $files = glob($pattern, $flags) ?: []; |
| 147 | - $dirs = glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) ?: []; |
|
| 147 | + $dirs = glob(dirname($pattern).'/*', GLOB_ONLYDIR | GLOB_NOSORT) ?: []; |
|
| 148 | 148 | |
| 149 | 149 | foreach ($dirs as $dir) { |
| 150 | - $files = [...$files, ...$this->glob_recursive($dir . '/' . basename($pattern), $flags)]; |
|
| 150 | + $files = [...$files, ...$this->glob_recursive($dir.'/'.basename($pattern), $flags)]; |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | return $files; |