@@ -16,31 +16,31 @@ |
||
16 | 16 | { |
17 | 17 | /** {@inheritdoc} */ |
18 | 18 | protected function loadInternal( |
19 | - array $mergedConfig, |
|
20 | - ContainerBuilder $container |
|
19 | + array $mergedConfig, |
|
20 | + ContainerBuilder $container |
|
21 | 21 | ) { |
22 | 22 | $container->getParameterBag() |
23 | - ->set( |
|
23 | + ->set( |
|
24 | 24 | 'basster_legacy_bridge.legacy_path', |
25 | 25 | $mergedConfig['legacy_path'] |
26 | - ) |
|
26 | + ) |
|
27 | 27 | ; |
28 | 28 | $container->getParameterBag() |
29 | - ->set( |
|
29 | + ->set( |
|
30 | 30 | 'basster_legacy_bridge.prepend_script', |
31 | 31 | $mergedConfig['prepend_script'] |
32 | - ) |
|
32 | + ) |
|
33 | 33 | ; |
34 | 34 | $container->getParameterBag() |
35 | - ->set( |
|
35 | + ->set( |
|
36 | 36 | 'basster_legacy_bridge.append_script', |
37 | 37 | $mergedConfig['append_script'] |
38 | - ) |
|
38 | + ) |
|
39 | 39 | ; |
40 | 40 | |
41 | 41 | $loader = new Loader\XmlFileLoader( |
42 | - $container, |
|
43 | - new FileLocator(__DIR__ . '/../Resources/config') |
|
42 | + $container, |
|
43 | + new FileLocator(__DIR__ . '/../Resources/config') |
|
44 | 44 | ); |
45 | 45 | $loader->load('services.xml'); |
46 | 46 | } |
@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | * @dataProvider provideConfigs |
14 | 14 | */ |
15 | 15 | public function setLegacyPath( |
16 | - array $config, |
|
17 | - $path, |
|
18 | - $prepend = null, |
|
19 | - $append = null |
|
16 | + array $config, |
|
17 | + $path, |
|
18 | + $prepend = null, |
|
19 | + $append = null |
|
20 | 20 | ) { |
21 | 21 | $bag = new ParameterBag(); |
22 | 22 | |
@@ -24,19 +24,19 @@ discard block |
||
24 | 24 | $extension->load($config, new ContainerBuilder($bag)); |
25 | 25 | |
26 | 26 | self::assertEquals($path, |
27 | - $bag->get('basster_legacy_bridge.legacy_path')); |
|
27 | + $bag->get('basster_legacy_bridge.legacy_path')); |
|
28 | 28 | self::assertEquals($prepend, |
29 | - $bag->get('basster_legacy_bridge.prepend_script')); |
|
29 | + $bag->get('basster_legacy_bridge.prepend_script')); |
|
30 | 30 | self::assertEquals($append, |
31 | - $bag->get('basster_legacy_bridge.append_script')); |
|
31 | + $bag->get('basster_legacy_bridge.append_script')); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | public function provideConfigs() |
35 | 35 | { |
36 | 36 | $pathOnly = array( |
37 | - 'basster_legacy_bridge' => array( |
|
37 | + 'basster_legacy_bridge' => array( |
|
38 | 38 | 'legacy_path' => __DIR__, |
39 | - ), |
|
39 | + ), |
|
40 | 40 | ); |
41 | 41 | |
42 | 42 | $prependOnly = $pathOnly; |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | $all['basster_legacy_bridge']['prepend_script'] = __FILE__; |
51 | 51 | |
52 | 52 | return array( |
53 | - 'path-only' => array($pathOnly, __DIR__, null, null), |
|
54 | - 'with-prepend-only' => array($prependOnly, __DIR__, __FILE__, null), |
|
55 | - 'with-append-only' => array($appendOnly, __DIR__, null, __FILE__), |
|
56 | - 'all' => array($all, __DIR__, __FILE__, __FILE__), |
|
53 | + 'path-only' => array($pathOnly, __DIR__, null, null), |
|
54 | + 'with-prepend-only' => array($prependOnly, __DIR__, __FILE__, null), |
|
55 | + 'with-append-only' => array($appendOnly, __DIR__, null, __FILE__), |
|
56 | + 'all' => array($all, __DIR__, __FILE__, __FILE__), |
|
57 | 57 | ); |
58 | 58 | } |
59 | 59 | } |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | $legacyPathNode = $this->getChildNode('legacy_path'); |
27 | 27 | |
28 | 28 | self::assertEquals( |
29 | - '/path/to/my/legacy/project/files', |
|
30 | - $legacyPathNode->getDefaultValue() |
|
29 | + '/path/to/my/legacy/project/files', |
|
30 | + $legacyPathNode->getDefaultValue() |
|
31 | 31 | ); |
32 | 32 | } |
33 | 33 | |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | public function provideNullDefaultNodes() |
61 | 61 | { |
62 | 62 | return array( |
63 | - 'append_script' => array('append_script'), |
|
64 | - 'prepend_script' => array('prepend_script'), |
|
63 | + 'append_script' => array('append_script'), |
|
64 | + 'prepend_script' => array('prepend_script'), |
|
65 | 65 | ); |
66 | 66 | } |
67 | 67 |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | self::assertNotNull($legacyRoute); |
28 | 28 | self::assertEquals($routePath, $legacyRoute->getPath()); |
29 | 29 | self::assertEquals($this->legacyFile->url(), |
30 | - $legacyRoute->getDefault('legacyScript')); |
|
30 | + $legacyRoute->getDefault('legacyScript')); |
|
31 | 31 | self::assertEquals($routePath, $legacyRoute->getDefault('requestPath')); |
32 | 32 | } |
33 | 33 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | public function supportsLegacyType() |
49 | 49 | { |
50 | 50 | self::assertTrue( |
51 | - $this->routeLoader->supports("don't mind...", 'legacy') |
|
51 | + $this->routeLoader->supports("don't mind...", 'legacy') |
|
52 | 52 | ); |
53 | 53 | } |
54 | 54 |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function dontSupportWhenPathIsNotExisting() |
52 | 52 | { |
53 | - $this->routeLoader = new LegacyRouteLoader(__DIR__.'/not_existing'); |
|
53 | + $this->routeLoader = new LegacyRouteLoader(__DIR__ . '/not_existing'); |
|
54 | 54 | self::assertFalse($this->routeLoader->supports('any', 'legacy')); |
55 | 55 | } |
56 | 56 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | /** {@inheritdoc} */ |
79 | 79 | protected function setUp() |
80 | 80 | { |
81 | - $this->root = vfsStream::setup(); |
|
81 | + $this->root = vfsStream::setup(); |
|
82 | 82 | $this->legacyFile = vfsStream::newFile('hello.php')->at($this->root); |
83 | 83 | $this->routeLoader = new LegacyRouteLoader($this->root->url()); |
84 | 84 | } |
@@ -36,13 +36,13 @@ |
||
36 | 36 | private function doRunLegacyScript() |
37 | 37 | { |
38 | 38 | $streamedResponse = $this->controller->runLegacyScript( |
39 | - $this->legacyFile->getPathname(), |
|
40 | - $this->legacyFile->getRelativePathname() |
|
39 | + $this->legacyFile->getPathname(), |
|
40 | + $this->legacyFile->getRelativePathname() |
|
41 | 41 | ); |
42 | 42 | |
43 | 43 | self::assertInstanceOf( |
44 | - 'Symfony\Component\HttpFoundation\StreamedResponse', |
|
45 | - $streamedResponse |
|
44 | + 'Symfony\Component\HttpFoundation\StreamedResponse', |
|
45 | + $streamedResponse |
|
46 | 46 | ); |
47 | 47 | |
48 | 48 | $streamedResponse->sendContent(); |
@@ -37,11 +37,11 @@ |
||
37 | 37 | $append = $this->appendScript; |
38 | 38 | |
39 | 39 | $requireLegacyScript = function () use ( |
40 | - $requestPath, |
|
41 | - $legacyScript, |
|
42 | - $container, |
|
43 | - $prepend, |
|
44 | - $append |
|
40 | + $requestPath, |
|
41 | + $legacyScript, |
|
42 | + $container, |
|
43 | + $prepend, |
|
44 | + $append |
|
45 | 45 | ) { |
46 | 46 | $_SERVER['PHP_SELF'] = $requestPath; |
47 | 47 | $_SERVER['SCRIPT_NAME'] = $requestPath; |
@@ -36,7 +36,7 @@ |
||
36 | 36 | $prepend = $this->prependScript; |
37 | 37 | $append = $this->appendScript; |
38 | 38 | |
39 | - $requireLegacyScript = function () use ( |
|
39 | + $requireLegacyScript = function() use ( |
|
40 | 40 | $requestPath, |
41 | 41 | $legacyScript, |
42 | 42 | $container, |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $this->initFinder(); |
51 | 51 | |
52 | 52 | $defaults = array( |
53 | - '_controller' => 'basster_legacy_bridge.legacy_controller:runLegacyScript', |
|
53 | + '_controller' => 'basster_legacy_bridge.legacy_controller:runLegacyScript', |
|
54 | 54 | ); |
55 | 55 | |
56 | 56 | /** @var SplFileInfo $file */ |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | private function initFinder() |
81 | 81 | { |
82 | 82 | $this->finder->ignoreDotFiles(true) |
83 | - ->files() |
|
84 | - ->name('*.php') |
|
85 | - ->in($this->legacyPath); |
|
83 | + ->files() |
|
84 | + ->name('*.php') |
|
85 | + ->in($this->legacyPath); |
|
86 | 86 | } |
87 | 87 | /** |
88 | 88 | * @param SplFileInfo $file |
@@ -92,10 +92,10 @@ discard block |
||
92 | 92 | private function createLegacyRouteName(SplFileInfo $file) |
93 | 93 | { |
94 | 94 | return 'basster.legacy.'. |
95 | - str_replace( |
|
95 | + str_replace( |
|
96 | 96 | '/', |
97 | 97 | '__', |
98 | 98 | substr($file->getRelativePathname(), 0, -4) |
99 | - ); |
|
99 | + ); |
|
100 | 100 | } |
101 | 101 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | /** @var SplFileInfo $file */ |
57 | 57 | foreach ($this->finder as $file) { |
58 | 58 | $defaults['legacyScript'] = $file->getPathname(); |
59 | - $defaults['requestPath'] = '/'.$file->getRelativePathname(); |
|
59 | + $defaults['requestPath'] = '/' . $file->getRelativePathname(); |
|
60 | 60 | |
61 | 61 | $route = new Route($file->getRelativePathname(), $defaults); |
62 | 62 | $routes->add($this->createLegacyRouteName($file), $route); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | private function createLegacyRouteName(SplFileInfo $file) |
93 | 93 | { |
94 | - return 'basster.legacy.'. |
|
94 | + return 'basster.legacy.' . |
|
95 | 95 | str_replace( |
96 | 96 | '/', |
97 | 97 | '__', |
@@ -21,19 +21,19 @@ |
||
21 | 21 | : $treeBuilder->root('basster_legacy_bridge'); |
22 | 22 | |
23 | 23 | $rootNode |
24 | - ->children() |
|
25 | - ->scalarNode('legacy_path') |
|
26 | - ->defaultValue('/path/to/my/legacy/project/files') |
|
27 | - ->end() |
|
28 | - ->scalarNode('append_script') |
|
29 | - ->info('optional append script (see http://php.net/manual/en/ini.core.php#ini.auto-append-file)') |
|
30 | - ->defaultNull() |
|
31 | - ->end() |
|
32 | - ->scalarNode('prepend_script') |
|
33 | - ->info('optional prepend script (see http://php.net/manual/en/ini.core.php#ini.auto-prepend-file)') |
|
34 | - ->defaultNull() |
|
35 | - ->end() |
|
36 | - ->end() |
|
24 | + ->children() |
|
25 | + ->scalarNode('legacy_path') |
|
26 | + ->defaultValue('/path/to/my/legacy/project/files') |
|
27 | + ->end() |
|
28 | + ->scalarNode('append_script') |
|
29 | + ->info('optional append script (see http://php.net/manual/en/ini.core.php#ini.auto-append-file)') |
|
30 | + ->defaultNull() |
|
31 | + ->end() |
|
32 | + ->scalarNode('prepend_script') |
|
33 | + ->info('optional prepend script (see http://php.net/manual/en/ini.core.php#ini.auto-prepend-file)') |
|
34 | + ->defaultNull() |
|
35 | + ->end() |
|
36 | + ->end() |
|
37 | 37 | ; |
38 | 38 | |
39 | 39 | return $treeBuilder; |