Completed
Pull Request — master (#1)
by Pascal
12:57
created
Command/TranslationConverterCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
         $dumper = $this->getDumper($outputFormat);
80 80
         $this->getTranslationWriter()->addDumper($outputFormat, $dumper);
81 81
 
82
-        $files = $this->finder->files()->name('/[a-z]+\.[a-z]{2}\.'.$inputFormat.'/')->in($path);
82
+        $files = $this->finder->files()->name('/[a-z]+\.[a-z]{2}\.' . $inputFormat . '/')->in($path);
83 83
 
84 84
         foreach ($files as $file) {
85 85
             list($domain, $language) = explode('.', $file->getFilename());
Please login to merge, or discard this patch.
Tests/App/AppKernel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,6 +38,6 @@
 block discarded – undo
38 38
      */
39 39
     public function registerContainerConfiguration(LoaderInterface $loader)
40 40
     {
41
-        $loader->load(__DIR__.'/config.yml');
41
+        $loader->load(__DIR__ . '/config.yml');
42 42
     }
43 43
 }
Please login to merge, or discard this patch.
Tests/App/cache/test/AppTestDebugProjectContainer.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
      */
209 209
     protected function getAnnotationReaderService()
210 210
     {
211
-        return $this->services['annotation_reader'] = new \Doctrine\Common\Annotations\CachedReader(new \Doctrine\Common\Annotations\AnnotationReader(), new \Doctrine\Common\Cache\FilesystemCache((__DIR__.'/annotations')), true);
211
+        return $this->services['annotation_reader'] = new \Doctrine\Common\Annotations\CachedReader(new \Doctrine\Common\Annotations\AnnotationReader(), new \Doctrine\Common\Cache\FilesystemCache((__DIR__ . '/annotations')), true);
212 212
     }
213 213
 
214 214
     /**
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
         $a = $this->get('kernel');
264 264
         $b = $this->get('templating.filename_parser');
265 265
 
266
-        $c = new \Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinder($a, $b, ($this->targetDirs[2].'/Resources'));
266
+        $c = new \Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinder($a, $b, ($this->targetDirs[2] . '/Resources'));
267 267
 
268 268
         return $this->services['cache_warmer'] = new \Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate(array(0 => new \Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplatePathsCacheWarmer($c, $this->get('templating.locator')), 1 => $this->get('kernel.class_cache.cache_warmer'), 2 => new \Symfony\Bundle\FrameworkBundle\CacheWarmer\TranslationsCacheWarmer($this->get('translator')), 3 => new \Symfony\Bundle\FrameworkBundle\CacheWarmer\RouterCacheWarmer($this->get('router')), 4 => new \Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer($this, $c, array()), 5 => new \Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheWarmer($this->get('twig'), new \Symfony\Bundle\TwigBundle\TemplateIterator($a, $this->targetDirs[2], array()))));
269 269
     }
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
      */
357 357
     protected function getFileLocatorService()
358 358
     {
359
-        return $this->services['file_locator'] = new \Symfony\Component\HttpKernel\Config\FileLocator($this->get('kernel'), ($this->targetDirs[2].'/Resources'));
359
+        return $this->services['file_locator'] = new \Symfony\Component\HttpKernel\Config\FileLocator($this->get('kernel'), ($this->targetDirs[2] . '/Resources'));
360 360
     }
361 361
 
362 362
     /**
@@ -1116,7 +1116,7 @@  discard block
 block discarded – undo
1116 1116
      */
1117 1117
     protected function getMonolog_Handler_NestedService()
1118 1118
     {
1119
-        return $this->services['monolog.handler.nested'] = new \Monolog\Handler\StreamHandler(($this->targetDirs[2].'/logs/test.log'), 100, true, NULL);
1119
+        return $this->services['monolog.handler.nested'] = new \Monolog\Handler\StreamHandler(($this->targetDirs[2] . '/logs/test.log'), 100, true, NULL);
1120 1120
     }
1121 1121
 
1122 1122
     /**
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
      */
1290 1290
     protected function getRouterService()
1291 1291
     {
1292
-        $this->services['router'] = $instance = new \Symfony\Bundle\FrameworkBundle\Routing\Router($this, ($this->targetDirs[2].'/routing.yml'), array('cache_dir' => __DIR__, 'debug' => true, 'generator_class' => 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', 'generator_base_class' => 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', 'generator_dumper_class' => 'Symfony\\Component\\Routing\\Generator\\Dumper\\PhpGeneratorDumper', 'generator_cache_class' => 'AppTestUrlGenerator', 'matcher_class' => 'Symfony\\Bundle\\FrameworkBundle\\Routing\\RedirectableUrlMatcher', 'matcher_base_class' => 'Symfony\\Bundle\\FrameworkBundle\\Routing\\RedirectableUrlMatcher', 'matcher_dumper_class' => 'Symfony\\Component\\Routing\\Matcher\\Dumper\\PhpMatcherDumper', 'matcher_cache_class' => 'AppTestUrlMatcher', 'strict_requirements' => true), $this->get('router.request_context', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('monolog.logger.router', ContainerInterface::NULL_ON_INVALID_REFERENCE));
1292
+        $this->services['router'] = $instance = new \Symfony\Bundle\FrameworkBundle\Routing\Router($this, ($this->targetDirs[2] . '/routing.yml'), array('cache_dir' => __DIR__, 'debug' => true, 'generator_class' => 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', 'generator_base_class' => 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', 'generator_dumper_class' => 'Symfony\\Component\\Routing\\Generator\\Dumper\\PhpGeneratorDumper', 'generator_cache_class' => 'AppTestUrlGenerator', 'matcher_class' => 'Symfony\\Bundle\\FrameworkBundle\\Routing\\RedirectableUrlMatcher', 'matcher_base_class' => 'Symfony\\Bundle\\FrameworkBundle\\Routing\\RedirectableUrlMatcher', 'matcher_dumper_class' => 'Symfony\\Component\\Routing\\Matcher\\Dumper\\PhpMatcherDumper', 'matcher_cache_class' => 'AppTestUrlMatcher', 'strict_requirements' => true), $this->get('router.request_context', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('monolog.logger.router', ContainerInterface::NULL_ON_INVALID_REFERENCE));
1293 1293
 
1294 1294
         $instance->setConfigCacheFactory($this->get('config_cache_factory'));
1295 1295
 
@@ -1397,7 +1397,7 @@  discard block
 block discarded – undo
1397 1397
      */
1398 1398
     protected function getSession_HandlerService()
1399 1399
     {
1400
-        return $this->services['session.handler'] = new \Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler((__DIR__.'/sessions'));
1400
+        return $this->services['session.handler'] = new \Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler((__DIR__ . '/sessions'));
1401 1401
     }
1402 1402
 
1403 1403
     /**
@@ -1423,7 +1423,7 @@  discard block
 block discarded – undo
1423 1423
      */
1424 1424
     protected function getSession_Storage_FilesystemService()
1425 1425
     {
1426
-        return $this->services['session.storage.filesystem'] = new \Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage((__DIR__.'/sessions'), 'MOCKSESSID', $this->get('session.storage.metadata_bag'));
1426
+        return $this->services['session.storage.filesystem'] = new \Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage((__DIR__ . '/sessions'), 'MOCKSESSID', $this->get('session.storage.metadata_bag'));
1427 1427
     }
1428 1428
 
1429 1429
     /**
@@ -1982,7 +1982,7 @@  discard block
 block discarded – undo
1982 1982
      */
1983 1983
     protected function getTranslator_DefaultService()
1984 1984
     {
1985
-        $this->services['translator.default'] = $instance = new \Symfony\Bundle\FrameworkBundle\Translation\Translator($this, $this->get('translator.selector'), array('translation.loader.php' => array(0 => 'php'), 'translation.loader.yml' => array(0 => 'yml'), 'translation.loader.xliff' => array(0 => 'xlf', 1 => 'xliff'), 'translation.loader.po' => array(0 => 'po'), 'translation.loader.mo' => array(0 => 'mo'), 'translation.loader.qt' => array(0 => 'ts'), 'translation.loader.csv' => array(0 => 'csv'), 'translation.loader.res' => array(0 => 'res'), 'translation.loader.dat' => array(0 => 'dat'), 'translation.loader.ini' => array(0 => 'ini'), 'translation.loader.json' => array(0 => 'json')), array('cache_dir' => (__DIR__.'/translations'), 'debug' => true), array());
1985
+        $this->services['translator.default'] = $instance = new \Symfony\Bundle\FrameworkBundle\Translation\Translator($this, $this->get('translator.selector'), array('translation.loader.php' => array(0 => 'php'), 'translation.loader.yml' => array(0 => 'yml'), 'translation.loader.xliff' => array(0 => 'xlf', 1 => 'xliff'), 'translation.loader.po' => array(0 => 'po'), 'translation.loader.mo' => array(0 => 'mo'), 'translation.loader.qt' => array(0 => 'ts'), 'translation.loader.csv' => array(0 => 'csv'), 'translation.loader.res' => array(0 => 'res'), 'translation.loader.dat' => array(0 => 'dat'), 'translation.loader.ini' => array(0 => 'ini'), 'translation.loader.json' => array(0 => 'json')), array('cache_dir' => (__DIR__ . '/translations'), 'debug' => true), array());
1986 1986
 
1987 1987
         $instance->setConfigCacheFactory($this->get('config_cache_factory'));
1988 1988
 
@@ -2027,7 +2027,7 @@  discard block
 block discarded – undo
2027 2027
         }
2028 2028
         $f->setContainer($this);
2029 2029
 
2030
-        $this->services['twig'] = $instance = new \Twig_Environment($this->get('twig.loader'), array('exception_controller' => 'twig.controller.exception:showAction', 'form_themes' => array(0 => 'form_div_layout.html.twig'), 'autoescape' => 'filename', 'cache' => (__DIR__.'/twig'), 'charset' => 'UTF-8', 'debug' => true, 'paths' => array(), 'date' => array('format' => 'F j, Y H:i', 'interval_format' => '%d days', 'timezone' => NULL), 'number_format' => array('decimals' => 0, 'decimal_point' => '.', 'thousands_separator' => ',')));
2030
+        $this->services['twig'] = $instance = new \Twig_Environment($this->get('twig.loader'), array('exception_controller' => 'twig.controller.exception:showAction', 'form_themes' => array(0 => 'form_div_layout.html.twig'), 'autoescape' => 'filename', 'cache' => (__DIR__ . '/twig'), 'charset' => 'UTF-8', 'debug' => true, 'paths' => array(), 'date' => array('format' => 'F j, Y H:i', 'interval_format' => '%d days', 'timezone' => NULL), 'number_format' => array('decimals' => 0, 'decimal_point' => '.', 'thousands_separator' => ',')));
2031 2031
 
2032 2032
         $instance->addExtension(new \Symfony\Bridge\Twig\Extension\ProfilerExtension($this->get('twig.profile'), $a));
2033 2033
         $instance->addExtension(new \Symfony\Bridge\Twig\Extension\TranslationExtension($this->get('translator')));
@@ -2099,10 +2099,10 @@  discard block
 block discarded – undo
2099 2099
     {
2100 2100
         $this->services['twig.loader'] = $instance = new \Symfony\Bundle\TwigBundle\Loader\FilesystemLoader($this->get('templating.locator'), $this->get('templating.name_parser'));
2101 2101
 
2102
-        $instance->addPath(($this->targetDirs[4].'/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views'), 'Framework');
2103
-        $instance->addPath(($this->targetDirs[4].'/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/views'), 'Security');
2104
-        $instance->addPath(($this->targetDirs[4].'/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views'), 'Twig');
2105
-        $instance->addPath(($this->targetDirs[4].'/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form'));
2102
+        $instance->addPath(($this->targetDirs[4] . '/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views'), 'Framework');
2103
+        $instance->addPath(($this->targetDirs[4] . '/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/views'), 'Security');
2104
+        $instance->addPath(($this->targetDirs[4] . '/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views'), 'Twig');
2105
+        $instance->addPath(($this->targetDirs[4] . '/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form'));
2106 2106
 
2107 2107
         return $instance;
2108 2108
     }
@@ -2174,7 +2174,7 @@  discard block
 block discarded – undo
2174 2174
         $instance->setConstraintValidatorFactory(new \Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory($this, array('validator.expression' => 'validator.expression', 'Symfony\\Component\\Validator\\Constraints\\ExpressionValidator' => 'validator.expression', 'Symfony\\Component\\Validator\\Constraints\\EmailValidator' => 'validator.email')));
2175 2175
         $instance->setTranslator($this->get('translator'));
2176 2176
         $instance->setTranslationDomain('validators');
2177
-        $instance->addXmlMappings(array(0 => ($this->targetDirs[4].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/config/validation.xml')));
2177
+        $instance->addXmlMappings(array(0 => ($this->targetDirs[4] . '/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/config/validation.xml')));
2178 2178
         $instance->enableAnnotationMapping($this->get('annotation_reader'));
2179 2179
         $instance->addMethodMapping('loadValidatorMetadata');
2180 2180
         $instance->addObjectInitializers(array());
@@ -2350,7 +2350,7 @@  discard block
 block discarded – undo
2350 2350
             'kernel.debug' => true,
2351 2351
             'kernel.name' => 'App',
2352 2352
             'kernel.cache_dir' => __DIR__,
2353
-            'kernel.logs_dir' => ($this->targetDirs[2].'/logs'),
2353
+            'kernel.logs_dir' => ($this->targetDirs[2] . '/logs'),
2354 2354
             'kernel.bundles' => array(
2355 2355
                 'FrameworkBundle' => 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle',
2356 2356
                 'SecurityBundle' => 'Symfony\\Bundle\\SecurityBundle\\SecurityBundle',
@@ -2439,7 +2439,7 @@  discard block
 block discarded – undo
2439 2439
                 'cookie_httponly' => true,
2440 2440
                 'gc_probability' => 1,
2441 2441
             ),
2442
-            'session.save_path' => (__DIR__.'/sessions'),
2442
+            'session.save_path' => (__DIR__ . '/sessions'),
2443 2443
             'session.metadata.update_threshold' => '0',
2444 2444
             'security.secure_random.class' => 'Symfony\\Component\\Security\\Core\\Util\\SecureRandom',
2445 2445
             'form.resolved_type_factory.class' => 'Symfony\\Component\\Form\\ResolvedFormTypeFactory',
@@ -2502,7 +2502,7 @@  discard block
 block discarded – undo
2502 2502
             'router.request_context.host' => 'localhost',
2503 2503
             'router.request_context.scheme' => 'http',
2504 2504
             'router.request_context.base_url' => '',
2505
-            'router.resource' => ($this->targetDirs[2].'/routing.yml'),
2505
+            'router.resource' => ($this->targetDirs[2] . '/routing.yml'),
2506 2506
             'router.cache_class_prefix' => 'AppTest',
2507 2507
             'request_listener.http_port' => 80,
2508 2508
             'request_listener.https_port' => 443,
@@ -2513,7 +2513,7 @@  discard block
 block discarded – undo
2513 2513
             'debug.stopwatch.class' => 'Symfony\\Component\\Stopwatch\\Stopwatch',
2514 2514
             'debug.error_handler.throw_at' => -1,
2515 2515
             'debug.event_dispatcher.class' => 'Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher',
2516
-            'debug.container.dump' => (__DIR__.'/AppTestDebugProjectContainer.xml'),
2516
+            'debug.container.dump' => (__DIR__ . '/AppTestDebugProjectContainer.xml'),
2517 2517
             'debug.controller_resolver.class' => 'Symfony\\Component\\HttpKernel\\Controller\\TraceableControllerResolver',
2518 2518
             'twig.class' => 'Twig_Environment',
2519 2519
             'twig.loader.filesystem.class' => 'Symfony\\Bundle\\TwigBundle\\Loader\\FilesystemLoader',
Please login to merge, or discard this patch.
Tests/Command/TranslationCommandTest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -19,13 +19,13 @@  discard block
 block discarded – undo
19 19
 
20 20
     protected function setUp()
21 21
     {
22
-        $this->exportPath = __DIR__.'/../../export';
23
-        $this->importPath =  __DIR__.'/../fixtures';
22
+        $this->exportPath = __DIR__ . '/../../export';
23
+        $this->importPath = __DIR__ . '/../fixtures';
24 24
 
25 25
         static::$kernel = static::createKernel();
26 26
         static::$kernel->boot();
27 27
 
28
-        $this->command     = new TranslationConverterCommand(
28
+        $this->command = new TranslationConverterCommand(
29 29
             static::$kernel->getContainer()->get('itkg_translation.finder'),
30 30
             static::$kernel->getContainer()->get('filesystem')
31 31
         );
@@ -40,12 +40,12 @@  discard block
 block discarded – undo
40 40
             'command' => 'itkg_translation:translation:converter',
41 41
             '--input' => 'yml',
42 42
             '--output' => 'csv',
43
-            '--path' => $this->importPath.'/data',
43
+            '--path' => $this->importPath . '/data',
44 44
             '--output-path' => $this->exportPath
45 45
         ));
46 46
 
47
-        $this->assertEquals(file_get_contents($this->exportPath.'/domain.en.csv'), file_get_contents($this->importPath.'/result/domain.en.csv'));
48
-        $this->assertEquals(file_get_contents($this->exportPath.'/messages.fr.csv'), file_get_contents($this->importPath.'/result/messages.fr.csv'));
47
+        $this->assertEquals(file_get_contents($this->exportPath . '/domain.en.csv'), file_get_contents($this->importPath . '/result/domain.en.csv'));
48
+        $this->assertEquals(file_get_contents($this->exportPath . '/messages.fr.csv'), file_get_contents($this->importPath . '/result/messages.fr.csv'));
49 49
     }
50 50
 
51 51
     public function testImport()
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
             'command' => 'itkg_translation:translation:converter',
55 55
             '--input' => 'csv',
56 56
             '--output' => 'yml',
57
-            '--path' => $this->importPath.'/data',
57
+            '--path' => $this->importPath . '/data',
58 58
             '--output-path' => $this->exportPath
59 59
         ));
60 60
 
61
-        $this->assertEquals(file_get_contents($this->exportPath.'/domain.en.yml'), file_get_contents($this->importPath.'/result/domain.en.yml'));
62
-        $this->assertEquals(file_get_contents($this->exportPath.'/messages.fr.yml'), file_get_contents($this->importPath.'/result/messages.fr.yml'));
61
+        $this->assertEquals(file_get_contents($this->exportPath . '/domain.en.yml'), file_get_contents($this->importPath . '/result/domain.en.yml'));
62
+        $this->assertEquals(file_get_contents($this->exportPath . '/messages.fr.yml'), file_get_contents($this->importPath . '/result/messages.fr.yml'));
63 63
     }
64 64
 }
Please login to merge, or discard this patch.