| @@ -28,6 +28,7 @@ discard block | ||
| 28 | 28 | * | 
| 29 | 29 | * @param string $format The format of the loader | 
| 30 | 30 | * @param LoaderInterface $loader | 
| 31 | + * @return void | |
| 31 | 32 | */ | 
| 32 | 33 | function addLoader($format, LoaderInterface $loader); | 
| 33 | 34 | |
| @@ -46,6 +47,7 @@ discard block | ||
| 46 | 47 | * @param string $domain | 
| 47 | 48 | * @param MessageCatalogue $catalogue | 
| 48 | 49 | * @throws LoaderNotFoundException | 
| 50 | + * @return void | |
| 49 | 51 | */ | 
| 50 | 52 | function loadResource($format, $resource, $domain, MessageCatalogue $catalogue); | 
| 51 | 53 | |
| @@ -65,9 +65,9 @@ | ||
| 65 | 65 | return NULL; | 
| 66 | 66 | } | 
| 67 | 67 | |
| 68 | - $s = strtolower($header); // case insensitive | |
| 69 | - $s = strtr($s, '_', '-'); // cs_CZ means cs-CZ | |
| 70 | - rsort($langs); // first more specific | |
| 68 | + $s = strtolower($header); // case insensitive | |
| 69 | + $s = strtr($s, '_', '-'); // cs_CZ means cs-CZ | |
| 70 | + rsort($langs); // first more specific | |
| 71 | 71 |  		preg_match_all('#(' . implode('|', $langs) . ')(?:-[^\s,;=]+)?\s*(?:;\s*q=([0-9.]+))?#', $s, $matches); | 
| 72 | 72 | |
| 73 | 73 |  		if (!$matches[0]) { | 
| @@ -87,7 +87,7 @@ | ||
| 87 | 87 | return NULL; | 
| 88 | 88 | } | 
| 89 | 89 | |
| 90 | -		$short = array_map(function ($locale) { | |
| 90 | +		$short = array_map(function($locale) { | |
| 91 | 91 | return substr($locale, 0, 2); | 
| 92 | 92 | }, $translator->getAvailableLocales()); | 
| 93 | 93 | |
| @@ -155,8 +155,7 @@ | ||
| 155 | 155 | $panel[] = $this->renderResources($this->ignoredResources); | 
| 156 | 156 | } | 
| 157 | 157 | |
| 158 | - return empty($panel) ? '' : | |
| 159 | - '<h1>Missing translations: ' . count(array_unique($this->untranslated, SORT_REGULAR)) . | |
| 158 | + return empty($panel) ? '' : '<h1>Missing translations: ' . count(array_unique($this->untranslated, SORT_REGULAR)) . | |
| 160 | 159 | ', Resources: ' . count(Nette\Utils\Arrays::flatten($this->resources)) . '</h1>' . | 
| 161 | 160 | '<div class="nette-inner tracy-inner kdyby-TranslationPanel" style="min-width:500px">' . implode($panel) . '</div>' . | 
| 162 | 161 | '<style> | 
| @@ -242,7 +242,7 @@ discard block | ||
| 242 | 242 | |
| 243 | 243 | |
| 244 | 244 | /** | 
| 245 | - * @param \Exception|\Throwable $e | |
| 245 | + * @param \Exception $e | |
| 246 | 246 | */ | 
| 247 | 247 | public function choiceError($e, $domain) | 
| 248 | 248 |  	{ | 
| @@ -359,6 +359,7 @@ discard block | ||
| 359 | 359 | /** | 
| 360 | 360 | * Returns link to editor. | 
| 361 | 361 | * @author David Grudl | 
| 362 | + * @param string $text | |
| 362 | 363 | * @return Nette\Utils\Html|string | 
| 363 | 364 | */ | 
| 364 | 365 | private static function editorLink($file, $line, $text = NULL) | 
| @@ -145,7 +145,7 @@ discard block | ||
| 145 | 145 | ->setInject(FALSE); | 
| 146 | 146 | |
| 147 | 147 | $loaders = $this->loadFromFile(__DIR__ . '/config/loaders.neon'); | 
| 148 | - $this->loadLoaders($loaders, $config['loaders'] ? : array_keys($loaders)); | |
| 148 | + $this->loadLoaders($loaders, $config['loaders'] ?: array_keys($loaders)); | |
| 149 | 149 | |
| 150 | 150 |  		if ($this->isRegisteredConsoleExtension()) { | 
| 151 | 151 | $this->loadConsole($config); | 
| @@ -263,7 +263,7 @@ discard block | ||
| 263 | 263 | |
| 264 | 264 | $this->beforeCompileLogging($config); | 
| 265 | 265 | |
| 266 | -		$registerToLatte = function (Nette\DI\ServiceDefinition $def) { | |
| 266 | +		$registerToLatte = function(Nette\DI\ServiceDefinition $def) { | |
| 267 | 267 | $def | 
| 268 | 268 |  				->addSetup('?->onCompile[] = function($engine) { Kdyby\Translation\Latte\TranslateMacros::install($engine->getCompiler()); }', array('@self')) | 
| 269 | 269 |  				->addSetup('addFilter', array('translate', array($this->prefix('@helpers'), 'translate'))) | 
| @@ -374,7 +374,7 @@ discard block | ||
| 374 | 374 | $whitelistRegexp = Kdyby\Translation\Translator::buildWhitelistRegexp($config['whitelist']); | 
| 375 | 375 |  		$translator = $builder->getDefinition($this->prefix('default')); | 
| 376 | 376 | |
| 377 | -		$mask = array_map(function ($value) { | |
| 377 | +		$mask = array_map(function($value) { | |
| 378 | 378 | return '*.*.' . $value; | 
| 379 | 379 | }, array_keys($this->loaders)); | 
| 380 | 380 | |
| @@ -485,7 +485,7 @@ discard block | ||
| 485 | 485 | */ | 
| 486 | 486 | public static function register(Nette\Configurator $configurator) | 
| 487 | 487 |  	{ | 
| 488 | -		$configurator->onCompile[] = function ($config, Nette\DI\Compiler $compiler) { | |
| 488 | +		$configurator->onCompile[] = function($config, Nette\DI\Compiler $compiler) { | |
| 489 | 489 |  			$compiler->addExtension('translation', new TranslationExtension()); | 
| 490 | 490 | }; | 
| 491 | 491 | } |