@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | $builder->addDefinition($this->prefix('helpers')) |
113 | 113 | ->setClass('Kdyby\Translation\TemplateHelpers') |
114 | - ->setFactory($this->prefix('@default') . '::createTemplateHelpers'); |
|
114 | + ->setFactory($this->prefix('@default').'::createTemplateHelpers'); |
|
115 | 115 | |
116 | 116 | $builder->addDefinition($this->prefix('fallbackResolver')) |
117 | 117 | ->setClass('Kdyby\Translation\FallbackResolver'); |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | $builder->addDefinition($this->prefix('loader')) |
136 | 136 | ->setClass('Kdyby\Translation\TranslationLoader'); |
137 | 137 | |
138 | - $loaders = $this->loadFromFile(__DIR__ . '/config/loaders.neon'); |
|
139 | - $this->loadLoaders($loaders, $config['loaders'] ? : array_keys($loaders)); |
|
138 | + $loaders = $this->loadFromFile(__DIR__.'/config/loaders.neon'); |
|
139 | + $this->loadLoaders($loaders, $config['loaders'] ?: array_keys($loaders)); |
|
140 | 140 | |
141 | 141 | if ($this->isRegisteredConsoleExtension()) { |
142 | 142 | $this->loadConsole($config); |
@@ -204,8 +204,8 @@ discard block |
||
204 | 204 | { |
205 | 205 | $builder = $this->getContainerBuilder(); |
206 | 206 | |
207 | - foreach ($this->loadFromFile(__DIR__ . '/config/dumpers.neon') as $format => $class) { |
|
208 | - $builder->addDefinition($this->prefix('dumper.' . $format)) |
|
207 | + foreach ($this->loadFromFile(__DIR__.'/config/dumpers.neon') as $format => $class) { |
|
208 | + $builder->addDefinition($this->prefix('dumper.'.$format)) |
|
209 | 209 | ->setClass($class) |
210 | 210 | ->addTag(self::TAG_DUMPER, $format); |
211 | 211 | } |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | if (array_search($format, $allowed) === FALSE) { |
222 | 222 | continue; |
223 | 223 | } |
224 | - $builder->addDefinition($this->prefix('loader.' . $format)) |
|
224 | + $builder->addDefinition($this->prefix('loader.'.$format)) |
|
225 | 225 | ->setClass($class) |
226 | 226 | ->addTag(self::TAG_LOADER, $format); |
227 | 227 | } |
@@ -233,8 +233,8 @@ discard block |
||
233 | 233 | { |
234 | 234 | $builder = $this->getContainerBuilder(); |
235 | 235 | |
236 | - foreach ($this->loadFromFile(__DIR__ . '/config/extractors.neon') as $format => $class) { |
|
237 | - $builder->addDefinition($this->prefix('extractor.' . $format)) |
|
236 | + foreach ($this->loadFromFile(__DIR__.'/config/extractors.neon') as $format => $class) { |
|
237 | + $builder->addDefinition($this->prefix('extractor.'.$format)) |
|
238 | 238 | ->setClass($class) |
239 | 239 | ->addTag(self::TAG_EXTRACTOR, $format); |
240 | 240 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | |
250 | 250 | $this->beforeCompileLogging($config); |
251 | 251 | |
252 | - $registerToLatte = function (Nette\DI\ServiceDefinition $def) { |
|
252 | + $registerToLatte = function(Nette\DI\ServiceDefinition $def) { |
|
253 | 253 | $def->addSetup('?->onCompile[] = function($engine) { Kdyby\Translation\Latte\TranslateMacros::install($engine->getCompiler()); }', ['@self']); |
254 | 254 | |
255 | 255 | $def->addSetup('addProvider', ['translator', $this->prefix('@default')]) |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | foreach ($builder->findByTag(self::TAG_EXTRACTOR) as $extractorId => $meta) { |
290 | 290 | Validators::assert($meta, 'string:2..'); |
291 | 291 | |
292 | - $extractor->addSetup('addExtractor', [$meta, '@' . $extractorId]); |
|
292 | + $extractor->addSetup('addExtractor', [$meta, '@'.$extractorId]); |
|
293 | 293 | |
294 | 294 | $builder->getDefinition($extractorId)->setAutowired(FALSE); |
295 | 295 | } |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | foreach ($builder->findByTag(self::TAG_DUMPER) as $dumperId => $meta) { |
299 | 299 | Validators::assert($meta, 'string:2..'); |
300 | 300 | |
301 | - $writer->addSetup('addDumper', [$meta, '@' . $dumperId]); |
|
301 | + $writer->addSetup('addDumper', [$meta, '@'.$dumperId]); |
|
302 | 302 | |
303 | 303 | $builder->getDefinition($dumperId)->setAutowired(FALSE); |
304 | 304 | } |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | $config['dirs'] = array_merge($config['dirs'], array_values($extension->getTranslationResources())); |
322 | 322 | } |
323 | 323 | |
324 | - $config['dirs'] = array_map(function ($dir) { |
|
324 | + $config['dirs'] = array_map(function($dir) { |
|
325 | 325 | return str_replace((DIRECTORY_SEPARATOR === '/') ? '\\' : '/', DIRECTORY_SEPARATOR, $dir); |
326 | 326 | }, $config['dirs']); |
327 | 327 | |
@@ -367,8 +367,8 @@ discard block |
||
367 | 367 | $whitelistRegexp = Kdyby\Translation\Translator::buildWhitelistRegexp($config['whitelist']); |
368 | 368 | $translator = $builder->getDefinition($this->prefix('default')); |
369 | 369 | |
370 | - $mask = array_map(function ($value) { |
|
371 | - return '*.*.' . $value; |
|
370 | + $mask = array_map(function($value) { |
|
371 | + return '*.*.'.$value; |
|
372 | 372 | }, array_keys($this->loaders)); |
373 | 373 | |
374 | 374 | foreach (Finder::findFiles($mask)->from($dirs) as $file) { |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | */ |
468 | 468 | public static function register(Nette\Configurator $configurator) |
469 | 469 | { |
470 | - $configurator->onCompile[] = function ($config, Nette\DI\Compiler $compiler) { |
|
470 | + $configurator->onCompile[] = function($config, Nette\DI\Compiler $compiler) { |
|
471 | 471 | $compiler->addExtension('translation', new TranslationExtension()); |
472 | 472 | }; |
473 | 473 | } |