Skip to content

Commit 9b57deb

Browse files
authored
Merge pull request #396 from FriendsOfSymfony/analysis-zRbBWD
Apply fixes from StyleCI
2 parents b09074f + c1d2b61 commit 9b57deb

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

EventListener/FlashMessageSubscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public static function getSubscribedEvents()
6565
*/
6666
public function onKernelResponse(FilterResponseEvent $event)
6767
{
68-
if ($event->getRequestType() !== HttpKernel::MASTER_REQUEST) {
68+
if (HttpKernel::MASTER_REQUEST !== $event->getRequestType()) {
6969
return;
7070
}
7171

EventListener/UserContextSubscriber.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function __construct(
100100
*/
101101
public function onKernelRequest(GetResponseEvent $event)
102102
{
103-
if ($event->getRequestType() != HttpKernelInterface::MASTER_REQUEST) {
103+
if (HttpKernelInterface::MASTER_REQUEST != $event->getRequestType()) {
104104
return;
105105
}
106106

@@ -154,7 +154,7 @@ private function isAnonymous(Request $request)
154154
*/
155155
public function onKernelResponse(FilterResponseEvent $event)
156156
{
157-
if ($event->getRequestType() != HttpKernelInterface::MASTER_REQUEST) {
157+
if (HttpKernelInterface::MASTER_REQUEST != $event->getRequestType()) {
158158
return;
159159
}
160160

Tests/Functional/Fixtures/Session/TestSessionStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function getBag($name)
105105
*/
106106
public function registerBag(SessionBagInterface $bag)
107107
{
108-
if ($bag->getName() == 'attributes') {
108+
if ('attributes' == $bag->getName()) {
109109
$bag->set('_security_secured_area', serialize(new UsernamePasswordToken('user', 'user', 'in_memory', array('ROLE_USER'))));
110110
}
111111

Tests/Unit/DependencyInjection/FOSHttpCacheExtensionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ private function assertMatcherCreated(ContainerBuilder $container, array $attrib
401401
$matcherId = null;
402402
foreach ($container->getDefinitions() as $id => $definition) {
403403
if ($definition instanceof DefinitionDecorator &&
404-
$definition->getParent() === 'fos_http_cache.request_matcher'
404+
'fos_http_cache.request_matcher' === $definition->getParent()
405405
) {
406406
if ($matcherDefinition) {
407407
$this->fail('More then one request matcher was created');
@@ -420,7 +420,7 @@ private function assertMatcherCreated(ContainerBuilder $container, array $attrib
420420
$ruleDefinition = null;
421421
foreach ($container->getDefinitions() as $definition) {
422422
if ($definition instanceof DefinitionDecorator &&
423-
$definition->getParent() === 'fos_http_cache.rule_matcher'
423+
'fos_http_cache.rule_matcher' === $definition->getParent()
424424
) {
425425
if ($ruleDefinition) {
426426
$this->fail('More then one rule matcher was created');

UserContext/AnonymousRequestMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function matches(Request $request)
3333
{
3434
foreach ($this->userIdentifierHeaders as $header) {
3535
if ($request->headers->has($header)) {
36-
if (strtolower($header) === 'cookie' && 0 === $request->cookies->count()) {
36+
if ('cookie' === strtolower($header) && 0 === $request->cookies->count()) {
3737
// ignore empty cookie header
3838
continue;
3939
}

UserContext/RequestMatcher.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ public function __construct($accept = 'application/vnd.fos.user-context-hash', $
3131
*/
3232
public function matches(Request $request)
3333
{
34-
if ($this->accept !== null && $this->accept != $request->headers->get('accept', null)) {
34+
if (null !== $this->accept && $this->accept != $request->headers->get('accept', null)) {
3535
return false;
3636
}
3737

38-
if ($this->method !== null && $this->method != $request->getMethod()) {
38+
if (null !== $this->method && $this->method != $request->getMethod()) {
3939
return false;
4040
}
4141

0 commit comments

Comments
 (0)