Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion EventListener/FlashMessageSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static function getSubscribedEvents()
*/
public function onKernelResponse(FilterResponseEvent $event)
{
if ($event->getRequestType() !== HttpKernel::MASTER_REQUEST) {
if (HttpKernel::MASTER_REQUEST !== $event->getRequestType()) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions EventListener/UserContextSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function __construct(
*/
public function onKernelRequest(GetResponseEvent $event)
{
if ($event->getRequestType() != HttpKernelInterface::MASTER_REQUEST) {
if (HttpKernelInterface::MASTER_REQUEST != $event->getRequestType()) {
return;
}

Expand Down Expand Up @@ -154,7 +154,7 @@ private function isAnonymous(Request $request)
*/
public function onKernelResponse(FilterResponseEvent $event)
{
if ($event->getRequestType() != HttpKernelInterface::MASTER_REQUEST) {
if (HttpKernelInterface::MASTER_REQUEST != $event->getRequestType()) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/Fixtures/Session/TestSessionStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function getBag($name)
*/
public function registerBag(SessionBagInterface $bag)
{
if ($bag->getName() == 'attributes') {
if ('attributes' == $bag->getName()) {
$bag->set('_security_secured_area', serialize(new UsernamePasswordToken('user', 'user', 'in_memory', array('ROLE_USER'))));
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/Unit/DependencyInjection/FOSHttpCacheExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ private function assertMatcherCreated(ContainerBuilder $container, array $attrib
$matcherId = null;
foreach ($container->getDefinitions() as $id => $definition) {
if ($definition instanceof DefinitionDecorator &&
$definition->getParent() === 'fos_http_cache.request_matcher'
'fos_http_cache.request_matcher' === $definition->getParent()
) {
if ($matcherDefinition) {
$this->fail('More then one request matcher was created');
Expand All @@ -420,7 +420,7 @@ private function assertMatcherCreated(ContainerBuilder $container, array $attrib
$ruleDefinition = null;
foreach ($container->getDefinitions() as $definition) {
if ($definition instanceof DefinitionDecorator &&
$definition->getParent() === 'fos_http_cache.rule_matcher'
'fos_http_cache.rule_matcher' === $definition->getParent()
) {
if ($ruleDefinition) {
$this->fail('More then one rule matcher was created');
Expand Down
2 changes: 1 addition & 1 deletion UserContext/AnonymousRequestMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function matches(Request $request)
{
foreach ($this->userIdentifierHeaders as $header) {
if ($request->headers->has($header)) {
if (strtolower($header) === 'cookie' && 0 === $request->cookies->count()) {
if ('cookie' === strtolower($header) && 0 === $request->cookies->count()) {
// ignore empty cookie header
continue;
}
Expand Down
4 changes: 2 additions & 2 deletions UserContext/RequestMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ public function __construct($accept = 'application/vnd.fos.user-context-hash', $
*/
public function matches(Request $request)
{
if ($this->accept !== null && $this->accept != $request->headers->get('accept', null)) {
if (null !== $this->accept && $this->accept != $request->headers->get('accept', null)) {
return false;
}

if ($this->method !== null && $this->method != $request->getMethod()) {
if (null !== $this->method && $this->method != $request->getMethod()) {
return false;
}

Expand Down