Skip to content

Commit 42806c8

Browse files
committed
Run php-cs-fixer
1 parent 32e4b58 commit 42806c8

35 files changed

+106
-108
lines changed

Command/BaseInvalidateCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111

1212
namespace FOS\HttpCacheBundle\Command;
1313

14-
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
15-
1614
use FOS\HttpCacheBundle\CacheManager;
15+
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
1716

1817
/**
1918
* Base class for commands to trigger cache invalidation from the command line.

Command/InvalidatePathCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Component\Console\Input\InputInterface;
1515
use Symfony\Component\Console\Output\OutputInterface;
1616
use Symfony\Component\Console\Input\InputArgument;
17-
1817
use FOS\HttpCacheBundle\CacheManager;
1918

2019
/**

Command/InvalidateRegexCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Component\Console\Input\InputInterface;
1515
use Symfony\Component\Console\Output\OutputInterface;
1616
use Symfony\Component\Console\Input\InputArgument;
17-
1817
use FOS\HttpCacheBundle\CacheManager;
1918

2019
/**

Command/InvalidateTagCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Component\Console\Input\InputInterface;
1515
use Symfony\Component\Console\Output\OutputInterface;
1616
use Symfony\Component\Console\Input\InputArgument;
17-
1817
use FOS\HttpCacheBundle\CacheManager;
1918

2019
/**

Command/RefreshPathCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Component\Console\Input\InputInterface;
1515
use Symfony\Component\Console\Output\OutputInterface;
1616
use Symfony\Component\Console\Input\InputArgument;
17-
1817
use FOS\HttpCacheBundle\CacheManager;
1918

2019
/**

Configuration/InvalidatePath.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class InvalidatePath extends ConfigurationAnnotation
3030
*/
3131
public function setValue($data)
3232
{
33-
$this->setPaths((is_array($data) ? $data: array($data)));
33+
$this->setPaths((is_array($data) ? $data : array($data)));
3434
}
3535

3636
/**

Configuration/Tag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Tag extends ConfigurationAnnotation
3030
*/
3131
public function setValue($data)
3232
{
33-
$this->setTags(is_array($data) ? $data: array($data));
33+
$this->setTags(is_array($data) ? $data : array($data));
3434
}
3535

3636
/**

DependencyInjection/Compiler/TagSubscriberPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function process(ContainerBuilder $container)
2929
) {
3030
throw new \RuntimeException(
3131
'Tag support requires SensioFrameworkExtraBundle’s ControllerListener for the annotations. '
32-
. 'Please install sensio/framework-extra-bundle and add it to your AppKernel.'
32+
.'Please install sensio/framework-extra-bundle and add it to your AppKernel.'
3333
);
3434
}
3535
}

DependencyInjection/Configuration.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,13 @@ private function addCacheControlSection(ArrayNodeDefinition $rootNode)
189189
->end()
190190
->scalarNode('last_modified')
191191
->validate()
192-
->ifTrue(function ($v) {if (is_string($v)) {new \DateTime($v);} return false;})
192+
->ifTrue(function ($v) {
193+
if (is_string($v)) {
194+
new \DateTime($v);
195+
}
196+
197+
return false;
198+
})
193199
->thenInvalid('') // this will never happen as new DateTime will throw an exception if $v is no date
194200
->end()
195201
->info('Set a default last modified timestamp if none is set yet. Value must be parseable by DateTime')

DependencyInjection/FOSHttpCacheExtension.php

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function load(array $configs, ContainerBuilder $container)
6565
$loader->load('cache_manager.xml');
6666
}
6767

68-
$container->setParameter($this->getAlias() . '.compiler_pass.tag_annotations', $config['tags']['enabled']);
68+
$container->setParameter($this->getAlias().'.compiler_pass.tag_annotations', $config['tags']['enabled']);
6969
if ($config['tags']['enabled']) {
7070
// true or auto
7171
$loader->load('tag_listener.xml');
@@ -105,7 +105,7 @@ public function load(array $configs, ContainerBuilder $container)
105105
*/
106106
private function loadCacheControl(ContainerBuilder $container, array $config)
107107
{
108-
$controlDefinition = $container->getDefinition($this->getAlias() . '.event_listener.cache_control');
108+
$controlDefinition = $container->getDefinition($this->getAlias().'.event_listener.cache_control');
109109

110110
foreach ($config['rules'] as $rule) {
111111
$ruleMatcher = $this->parseRuleMatcher($container, $rule['match']);
@@ -149,7 +149,7 @@ private function createRuleMatcher(ContainerBuilder $container, Reference $reque
149149
{
150150
$arguments = array((string) $requestMatcher, $extraCriteria);
151151
$serialized = serialize($arguments);
152-
$id = $this->getAlias() . '.rule_matcher.' . md5($serialized) . sha1($serialized);
152+
$id = $this->getAlias().'.rule_matcher.'.md5($serialized).sha1($serialized);
153153

154154
if (!$container->hasDefinition($id)) {
155155
$container
@@ -213,8 +213,8 @@ private function loadProxyClient(ContainerBuilder $container, XmlFileLoader $loa
213213
}
214214

215215
$container->setAlias(
216-
$this->getAlias() . '.default_proxy_client',
217-
$this->getAlias() . '.proxy_client.' . $this->getDefault($config)
216+
$this->getAlias().'.default_proxy_client',
217+
$this->getAlias().'.proxy_client.'.$this->getDefault($config)
218218
);
219219
}
220220

@@ -230,10 +230,10 @@ private function loadVarnish(ContainerBuilder $container, XmlFileLoader $loader,
230230
} else {
231231
$baseUrl = null;
232232
}
233-
$container->setParameter($this->getAlias() . '.proxy_client.varnish.servers', $config['servers']);
234-
$container->setParameter($this->getAlias() . '.proxy_client.varnish.base_url', $baseUrl);
233+
$container->setParameter($this->getAlias().'.proxy_client.varnish.servers', $config['servers']);
234+
$container->setParameter($this->getAlias().'.proxy_client.varnish.base_url', $baseUrl);
235235
if ($config['guzzle_client']) {
236-
$container->getDefinition($this->getAlias() . '.proxy_client.varnish')
236+
$container->getDefinition($this->getAlias().'.proxy_client.varnish')
237237
->addArgument(
238238
new Reference($config['guzzle_client'])
239239
)
@@ -252,14 +252,14 @@ private function loadNginx(ContainerBuilder $container, XmlFileLoader $loader, a
252252
} else {
253253
$baseUrl = null;
254254
}
255-
$container->setParameter($this->getAlias() . '.proxy_client.nginx.servers', $config['servers']);
256-
$container->setParameter($this->getAlias() . '.proxy_client.nginx.base_url', $baseUrl);
257-
$container->setParameter($this->getAlias() . '.proxy_client.nginx.purge_location', $config['purge_location']);
255+
$container->setParameter($this->getAlias().'.proxy_client.nginx.servers', $config['servers']);
256+
$container->setParameter($this->getAlias().'.proxy_client.nginx.base_url', $baseUrl);
257+
$container->setParameter($this->getAlias().'.proxy_client.nginx.purge_location', $config['purge_location']);
258258
}
259259

260260
private function loadTest(ContainerBuilder $container, XmlFileLoader $loader, array $config)
261261
{
262-
$container->setParameter($this->getAlias() . '.test.cache_header', $config['cache_header']);
262+
$container->setParameter($this->getAlias().'.test.cache_header', $config['cache_header']);
263263

264264
if ($config['proxy_server']) {
265265
$this->loadProxyServer($container, $loader, $config['proxy_server']);
@@ -270,18 +270,18 @@ private function loadTest(ContainerBuilder $container, XmlFileLoader $loader, ar
270270
$loader->load('test_client.xml');
271271

272272
if ($config['client']['varnish']['enabled']) {
273-
$container->getDefinition($this->getAlias() . '.test.client.varnish')
273+
$container->getDefinition($this->getAlias().'.test.client.varnish')
274274
->setAbstract(false);
275275
}
276276

277277
if ($config['client']['nginx']['enabled']) {
278-
$container->getDefinition($this->getAlias() . '.test.client.nginx')
278+
$container->getDefinition($this->getAlias().'.test.client.nginx')
279279
->setAbstract(false);
280280
}
281281

282282
$container->setAlias(
283-
$this->getAlias() . '.test.default_client',
284-
$this->getAlias() . '.test.client.' . $this->getDefault($config['client'])
283+
$this->getAlias().'.test.default_client',
284+
$this->getAlias().'.test.client.'.$this->getDefault($config['client'])
285285
);
286286
}
287287
}
@@ -297,8 +297,8 @@ private function loadProxyServer(ContainerBuilder $container, XmlFileLoader $loa
297297
}
298298

299299
$container->setAlias(
300-
$this->getAlias() . '.test.default_proxy_server',
301-
$this->getAlias() . '.test.proxy_server.' . $this->getDefault($config)
300+
$this->getAlias().'.test.default_proxy_server',
301+
$this->getAlias().'.test.proxy_server.'.$this->getDefault($config)
302302
);
303303
}
304304

@@ -307,7 +307,7 @@ private function loadVarnishProxyServer(ContainerBuilder $container, XmlFileLoad
307307
$loader->load('varnish_proxy.xml');
308308
foreach ($config as $key => $value) {
309309
$container->setParameter(
310-
$this->getAlias() . '.test.proxy_server.varnish.' . $key,
310+
$this->getAlias().'.test.proxy_server.varnish.'.$key,
311311
$value
312312
);
313313
}
@@ -318,15 +318,15 @@ private function loadNginxProxyServer(ContainerBuilder $container, XmlFileLoader
318318
$loader->load('nginx_proxy.xml');
319319
foreach ($config as $key => $value) {
320320
$container->setParameter(
321-
$this->getAlias() . '.test.proxy_server.nginx.' . $key,
321+
$this->getAlias().'.test.proxy_server.nginx.'.$key,
322322
$value
323323
);
324324
}
325325
}
326326

327327
private function loadTagRules(ContainerBuilder $container, array $config)
328328
{
329-
$tagDefinition = $container->getDefinition($this->getAlias() . '.event_listener.tag');
329+
$tagDefinition = $container->getDefinition($this->getAlias().'.event_listener.tag');
330330

331331
foreach ($config as $rule) {
332332
$ruleMatcher = $this->parseRuleMatcher($container, $rule['match']);
@@ -342,7 +342,7 @@ private function loadTagRules(ContainerBuilder $container, array $config)
342342

343343
private function loadInvalidatorRules(ContainerBuilder $container, array $config)
344344
{
345-
$tagDefinition = $container->getDefinition($this->getAlias() . '.event_listener.invalidation');
345+
$tagDefinition = $container->getDefinition($this->getAlias().'.event_listener.invalidation');
346346

347347
foreach ($config as $rule) {
348348
$ruleMatcher = $this->parseRuleMatcher($container, $rule['match']);
@@ -359,7 +359,6 @@ private function validateUrl($url, $msg)
359359
}
360360
}
361361

362-
363362
private function prefixSchema($url)
364363
{
365364
if (false === strpos($url, '://')) {

EventListener/CacheControlSubscriber.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ private function setExtraCacheDirectives(Response $response, array $controls, $o
202202
&& ($overwrite || !$response->headers->hasCacheControlDirective($option))
203203
) {
204204
$response->headers->addCacheControlDirective($option, $controls[$key]);
205-
206205
}
207206
}
208207
}

EventListener/InvalidationSubscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public static function getSubscribedEvents()
139139
KernelEvents::TERMINATE => 'onKernelTerminate',
140140
KernelEvents::EXCEPTION => 'onKernelException',
141141
ConsoleEvents::TERMINATE => 'onConsoleTerminate',
142-
ConsoleEvents::EXCEPTION => 'onConsoleTerminate'
142+
ConsoleEvents::EXCEPTION => 'onConsoleTerminate',
143143
);
144144
}
145145

EventListener/TagSubscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function onKernelResponse(FilterResponseEvent $event)
100100
public static function getSubscribedEvents()
101101
{
102102
return array(
103-
KernelEvents::RESPONSE => 'onKernelResponse'
103+
KernelEvents::RESPONSE => 'onKernelResponse',
104104
);
105105
}
106106

EventListener/UserContextSubscriber.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ public function __construct(
6262
array $userIdentifierHeaders = array('Cookie', 'Authorization'),
6363
$hashHeader = "X-User-Context-Hash",
6464
$ttl = 0
65-
)
66-
{
65+
) {
6766
if (!count($userIdentifierHeaders)) {
6867
throw new \InvalidArgumentException('The user context must vary on some request headers');
6968
}
@@ -97,7 +96,7 @@ public function onKernelRequest(GetResponseEvent $event)
9796
// status needs to be 200 as otherwise varnish will not cache the response.
9897
$response = new Response('', 200, array(
9998
$this->hashHeader => $hash,
100-
'Content-Type' => 'application/vnd.fos.user-context-hash'
99+
'Content-Type' => 'application/vnd.fos.user-context-hash',
101100
));
102101

103102
if ($this->ttl > 0) {

HttpCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ protected function cleanupForwardRequest(Request $forwardReq, Request $originalR
178178
{
179179
$sessionIds = array();
180180
foreach ($originalRequest->cookies as $name => $value) {
181-
if ( $this->isSessionName($name)) {
181+
if ($this->isSessionName($name)) {
182182
$sessionIds[$name] = $value;
183183
$forwardReq->cookies->set($name, $value);
184184
}

Security/Http/Logout/ContextInvalidationLogoutHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function logout(Request $request, Response $response, TokenInterface $tok
6161
foreach ($this->userIdentifierHeaders as $header) {
6262
$this->banner->ban(array(
6363
'accept' => $this->acceptHeader,
64-
$header => sprintf('.*%s.*', $sessionId)
64+
$header => sprintf('.*%s.*', $sessionId),
6565
));
6666
}
6767
}

Test/ProxyTestCase.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,10 @@ protected function getProxy()
112112
if (!static::getContainer()->has('fos_http_cache.test.default_proxy_server')) {
113113
throw new \RuntimeException(
114114
'Proxy server is not available. Please configure a proxy_server '
115-
. 'under test in your application config.'
115+
.'under test in your application config.'
116116
);
117117
}
118+
118119
return static::getContainer()->get('fos_http_cache.test.default_proxy_server');
119120
}
120121

Tests/Functional/Fixtures/Controller/TagController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function itemAction(Request $request, $id)
3636
$this->container->get('fos_http_cache.cache_manager')->invalidateTags(array('all-items'));
3737
}
3838

39-
return new Response('Item ' . $id . ' invalidated');
39+
return new Response('Item '.$id.' invalidated');
4040
}
4141

4242
/**

Tests/Functional/Fixtures/Controller/TestController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ class TestController extends Controller
1818
{
1919
public function contentAction($id = null)
2020
{
21-
return new Response('content ' . $id);
21+
return new Response('content '.$id);
2222
}
2323
}

Tests/Functional/Security/Http/Logout/ContextInvalidationLogoutHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public function testLogout()
1414
'fos_http_cache.proxy_client.varnish',
1515
'\FOS\HttpCache\ProxyClient\Varnish'
1616
)
17-
->shouldReceive('ban')->once()->with(array('accept'=>'application/vnd.fos.user-context-hash', 'Cookie' => '.*test.*'))
18-
->shouldReceive('ban')->once()->with(array('accept'=>'application/vnd.fos.user-context-hash', 'Authorization' => '.*test.*'))
17+
->shouldReceive('ban')->once()->with(array('accept' => 'application/vnd.fos.user-context-hash', 'Cookie' => '.*test.*'))
18+
->shouldReceive('ban')->once()->with(array('accept' => 'application/vnd.fos.user-context-hash', 'Authorization' => '.*test.*'))
1919
->shouldReceive('flush')->once()
2020
;
2121

Tests/Functional/Test/ProxyTestCaseAnnotationTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace FOS\HttpCacheBundle\Tests\Functional\Test;
1313

1414
use FOS\HttpCacheBundle\Test\ProxyTestCase;
15-
use Symfony\Bundle\FrameworkBundle\Tests\Functional\WebTestCase;
1615

1716
class ProxyTestCaseAnnotationTest extends ProxyTestCase
1817
{

Tests/Resources/Fixtures/config/full.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
$container->loadFromExtension('fos_http_cache', array(
44
'cache_control' => array(
55
'defaults' => array(
6-
'overwrite' => true
6+
'overwrite' => true,
77
),
88
'rules' => array(
99
array(

Tests/Resources/Fixtures/config/invalidation_rules.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
),
1111
'routes' => array(
1212
'routename' => array(),
13-
)
14-
)
15-
)
13+
),
14+
),
15+
),
1616
),
1717
));

Tests/Resources/Fixtures/config/tags_rules.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
'path' => '/def',
1010
),
1111
'tags' => array('a'),
12-
)
13-
)
12+
),
13+
),
1414
),
1515
));

Tests/Unit/Configuration/InvalidateRouteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testExecuteNoExpression()
4141
'params' => array(
4242
'id' => array(
4343
'this-is-not-expression' => 'something',
44-
)
44+
),
4545
),
4646
));
4747
}

Tests/Unit/DependencyInjection/Compiler/HashGeneratorPassTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ protected function getBaseConfig()
7373
'varnish' => array(
7474
'base_url' => 'my_hostname',
7575
'servers' => array(
76-
'127.0.0.1'
77-
)
78-
)
79-
)
76+
'127.0.0.1',
77+
),
78+
),
79+
),
8080
);
8181
}
8282
}

0 commit comments

Comments
 (0)