@@ -86,6 +86,9 @@ discard block |
||
86 | 86 | $this->assertSame('walkByLocaleInternal', $method->invoke($loader)); |
87 | 87 | } |
88 | 88 | |
89 | + /** |
|
90 | + * @param string $name |
|
91 | + */ |
|
89 | 92 | protected function createMock($name, array $methods = null) |
90 | 93 | { |
91 | 94 | $mock = $this->getMockBuilder($name) |
@@ -97,6 +100,10 @@ discard block |
||
97 | 100 | return $mock; |
98 | 101 | } |
99 | 102 | |
103 | + /** |
|
104 | + * @param string $name |
|
105 | + * @param string $value |
|
106 | + */ |
|
100 | 107 | protected function setProperty($instance, $name, $value) |
101 | 108 | { |
102 | 109 | $property = new \ReflectionProperty($instance, $name); |
@@ -145,6 +145,10 @@ |
||
145 | 145 | $this->assertEquals(new ArrayAccess($parameters), ArrayAccess::create($parameters)); |
146 | 146 | } |
147 | 147 | |
148 | + /** |
|
149 | + * @param ArrayAccess $instance |
|
150 | + * @param string $name |
|
151 | + */ |
|
148 | 152 | protected function getProperty($instance, $name) |
149 | 153 | { |
150 | 154 | $property = new \ReflectionProperty($instance, $name); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function testCreateCacheDefinition() |
154 | 154 | { |
155 | - list($register, ) = $this->getRegisterMockAndContainerWithParameter(); |
|
155 | + list($register,) = $this->getRegisterMockAndContainerWithParameter(); |
|
156 | 156 | $id = 'register_test'; |
157 | 157 | |
158 | 158 | // $register->bundleId = 'register_test' |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | ->with($suffix) |
195 | 195 | ->willReturn($expected) |
196 | 196 | ; |
197 | - $method = new \ReflectionMethod($register, $methodName); |
|
197 | + $method = new \ReflectionMethod($register, $methodName); |
|
198 | 198 | $method->setAccessible(true); |
199 | 199 | $this->assertSame($expected, $method->invoke($register)); |
200 | 200 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | { |
44 | 44 | $arrayLoader1 = $this->getMock('YahooJapan\ConfigCacheBundle\ConfigCache\Loader\ArrayLoaderInterface'); |
45 | 45 | $arrayLoader2 = $this->getMock('YahooJapan\ConfigCacheBundle\ConfigCache\Loader\ArrayLoaderInterface'); |
46 | - $loader = $this->getMockForAbstractClass('YahooJapan\ConfigCacheBundle\ConfigCache\Loader\Loader'); |
|
46 | + $loader = $this->getMockForAbstractClass('YahooJapan\ConfigCacheBundle\ConfigCache\Loader\Loader'); |
|
47 | 47 | $loader->addLoaders(array($arrayLoader1, $arrayLoader2)); |
48 | 48 | $loaders = new \ReflectionProperty($loader, 'loaders'); |
49 | 49 | $loaders->setAccessible(true); |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | |
427 | 427 | protected function createNoChildNode() |
428 | 428 | { |
429 | - list($treeBuilder, ) = $this->createTreeBuilder(); |
|
429 | + list($treeBuilder,) = $this->createTreeBuilder(); |
|
430 | 430 | |
431 | 431 | return $treeBuilder->buildTree(); |
432 | 432 | } |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | ->children() |
503 | 503 | ->scalarNode('zzz') |
504 | 504 | ->validate() |
505 | - ->ifTrue(function ($v) { |
|
505 | + ->ifTrue(function($v) { |
|
506 | 506 | return !preg_match('/^[A-Z\/]+$/', $v); |
507 | 507 | }) |
508 | 508 | ->thenInvalid('Unexpected node[%s]') |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | ->scalarNode('ccc')->end() |
524 | 524 | ->scalarNode('zzz') |
525 | 525 | ->validate() |
526 | - ->ifTrue(function ($v) { |
|
526 | + ->ifTrue(function($v) { |
|
527 | 527 | return !preg_match('/^[A-Z\/]+$/', $v); |
528 | 528 | }) |
529 | 529 | ->thenInvalid('Unexpected node value[%s]') |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $expectedFileNames = array($expectedFileName, $this->getHashFileName($expectedFileName)); |
131 | 131 | $finder = Finder::create() |
132 | 132 | ->files() |
133 | - ->filter(function (\SplFileInfo $file) use ($expectedFileNames) { |
|
133 | + ->filter(function(\SplFileInfo $file) use ($expectedFileNames) { |
|
134 | 134 | if (in_array($file->getFilename(), $expectedFileNames)) { |
135 | 135 | return true; |
136 | 136 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $expectedFileNames = array($expectedFileName, $this->getHashFileName($expectedFileName)); |
203 | 203 | $finder = Finder::create() |
204 | 204 | ->files() |
205 | - ->filter(function (\SplFileInfo $file) use ($expectedFileNames) { |
|
205 | + ->filter(function(\SplFileInfo $file) use ($expectedFileNames) { |
|
206 | 206 | if (in_array($file->getFilename(), $expectedFileNames)) { |
207 | 207 | return true; |
208 | 208 | } |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | */ |
471 | 471 | public function testProcessConfiguration($validated, $validating, $expected) |
472 | 472 | { |
473 | - $configuration = new ConfigCacheConfiguration(); |
|
473 | + $configuration = new ConfigCacheConfiguration(); |
|
474 | 474 | $method = new \ReflectionMethod(self::$cache, 'processConfiguration'); |
475 | 475 | $method->setAccessible(true); |
476 | 476 | try { |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | public function testRegisterOneInternal($resources, $expectedDirs, $expectedFiles) |
445 | 445 | { |
446 | 446 | $internalMethod = 'setCacheDefinition'; |
447 | - list($register, ) = $this->getRegisterMockAndContainerWithParameter(array($internalMethod)); |
|
447 | + list($register,) = $this->getRegisterMockAndContainerWithParameter(array($internalMethod)); |
|
448 | 448 | $id = 'register_test'; |
449 | 449 | |
450 | 450 | $bundleId = new \ReflectionProperty($register, 'bundleId'); |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | public function testRegisterAllInternal($bundles, $resources, $invokedCount, $expectedDirs, $expectedFiles) |
530 | 530 | { |
531 | 531 | $internalMethod = 'setCacheDefinition'; |
532 | - list($register, ) = $this->getRegisterMockAndContainerWithParameter(array($internalMethod)); |
|
532 | + list($register,) = $this->getRegisterMockAndContainerWithParameter(array($internalMethod)); |
|
533 | 533 | |
534 | 534 | $registerResources = new \ReflectionProperty($register, 'resources'); |
535 | 535 | $registerResources->setAccessible(true); |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | */ |
773 | 773 | public function testSetConfigurationByExtension($configuration, $expected) |
774 | 774 | { |
775 | - list($register, ) = $this->getRegisterMockAndContainer(); |
|
775 | + list($register,) = $this->getRegisterMockAndContainer(); |
|
776 | 776 | // mock of ConfigurationExtensionInterface in order to getConfiguration only |
777 | 777 | $extension = $this->getMock('Symfony\Component\DependencyInjection\Extension\ConfigurationExtensionInterface'); |
778 | 778 | $extension |
@@ -1336,7 +1336,7 @@ discard block |
||
1336 | 1336 | ->with($suffix) |
1337 | 1337 | ->willReturn($expected) |
1338 | 1338 | ; |
1339 | - $method = new \ReflectionMethod($register, $methodName); |
|
1339 | + $method = new \ReflectionMethod($register, $methodName); |
|
1340 | 1340 | $method->setAccessible(true); |
1341 | 1341 | $this->assertSame($expected, $method->invoke($register)); |
1342 | 1342 | } |
@@ -1344,15 +1344,15 @@ discard block |
||
1344 | 1344 | public function getIdProvider() |
1345 | 1345 | { |
1346 | 1346 | return array( |
1347 | - array('getYamlLoaderId', 'buildId', 'yaml_file_loader', 'config.yaml_file_loader'), |
|
1348 | - array('getXmlLoaderId', 'buildId', 'xml_file_loader', 'config.xml_file_loader'), |
|
1349 | - array('getLoaderResolverId', 'buildId', 'loader_resolver', 'config.loader_resolver'), |
|
1350 | - array('getDelegatingLoaderId', 'buildId', 'delegating_loader', 'config.delegatingloader'), |
|
1351 | - array('getPhpFileCacheClass', 'buildClassId', 'php_file_cache', 'config.php_file_cache.class'), |
|
1352 | - array('getConfigCacheClass', 'buildClassId', 'config_cache', 'config.config_cache.class'), |
|
1353 | - array('getYamlFileLoaderClass', 'buildClassId', 'yaml_file_loader', 'config.yaml_file_loader.class'), |
|
1354 | - array('getXmlFileLoaderClass', 'buildClassId', 'xml_file_loader', 'config.xml_file_loader.class'), |
|
1355 | - array('getLoaderResolverClass', 'buildClassId', 'loader_resolver', 'config.loader_resolver.class'), |
|
1347 | + array('getYamlLoaderId', 'buildId', 'yaml_file_loader', 'config.yaml_file_loader'), |
|
1348 | + array('getXmlLoaderId', 'buildId', 'xml_file_loader', 'config.xml_file_loader'), |
|
1349 | + array('getLoaderResolverId', 'buildId', 'loader_resolver', 'config.loader_resolver'), |
|
1350 | + array('getDelegatingLoaderId', 'buildId', 'delegating_loader', 'config.delegatingloader'), |
|
1351 | + array('getPhpFileCacheClass', 'buildClassId', 'php_file_cache', 'config.php_file_cache.class'), |
|
1352 | + array('getConfigCacheClass', 'buildClassId', 'config_cache', 'config.config_cache.class'), |
|
1353 | + array('getYamlFileLoaderClass', 'buildClassId', 'yaml_file_loader', 'config.yaml_file_loader.class'), |
|
1354 | + array('getXmlFileLoaderClass', 'buildClassId', 'xml_file_loader', 'config.xml_file_loader.class'), |
|
1355 | + array('getLoaderResolverClass', 'buildClassId', 'loader_resolver', 'config.loader_resolver.class'), |
|
1356 | 1356 | array('getDelegatingLoaderClass', 'buildClassId', 'delegating_loader', 'config.delegatingloader.class'), |
1357 | 1357 | ); |
1358 | 1358 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | ->defaultValue(0) |
43 | 43 | ->validate() |
44 | 44 | // priority must be less than LocaleListener priority |
45 | - ->ifTrue(function ($priority) { |
|
45 | + ->ifTrue(function($priority) { |
|
46 | 46 | return $priority >= Configuration::getPriorityMax(); |
47 | 47 | }) |
48 | 48 | ->thenInvalid('ConfigCacheListener priority[%s] must be less than LocaleListener priority['.Configuration::getPriorityMax().']') |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | ->end() |
51 | 51 | ->end() |
52 | 52 | ->validate() |
53 | - ->ifTrue(function ($locale) { |
|
53 | + ->ifTrue(function($locale) { |
|
54 | 54 | return $locale['enabled'] && $locale['locales'] === array(); |
55 | 55 | }) |
56 | 56 | ->thenInvalid('yahoo_japan_config_cache.locale.locales must be configured.') |
@@ -251,7 +251,7 @@ |
||
251 | 251 | { |
252 | 252 | $finder = Finder::create() |
253 | 253 | ->files() |
254 | - ->filter(function (\SplFileInfo $file) use ($excludes) { |
|
254 | + ->filter(function(\SplFileInfo $file) use ($excludes) { |
|
255 | 255 | foreach ($excludes as $exclude) { |
256 | 256 | if (strpos($file->getRealPath(), $exclude) !== false) { |
257 | 257 | return false; |