Completed
Push — master ( 46a2db...8f0beb )
by Filip
02:13
created
src/Kdyby/Translation/DI/TranslationExtension.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.