Skip to content

Commit 816c2b0

Browse files
committed
IBX-8121: Fixed code style for 5.0
1 parent 966b46f commit 816c2b0

40 files changed

+64
-25
lines changed

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@
3030
"toflar/psr6-symfony-http-cache-store": "^2.2 || ^3.0"
3131
},
3232
"require-dev": {
33-
"friendsofphp/php-cs-fixer": "^3.0",
3433
"ibexa/ci-scripts": "^0.2@dev",
35-
"ibexa/code-style": "^1.0",
34+
"ibexa/code-style": "~2.0.0",
3635
"ibexa/doctrine-schema": "~5.0.x-dev",
3736
"matthiasnoback/symfony-dependency-injection-test": "^4.3",
3837
"phpspec/phpspec": "^7.1",
39-
"phpunit/phpunit": "^8.5",
38+
"phpunit/phpunit": "^9.6",
4039
"symfony/phpunit-bridge": "^5.1"
4140
},
4241
"autoload": {
@@ -70,6 +69,7 @@
7069
}
7170
},
7271
"config": {
73-
"sort-packages": true
72+
"sort-packages": true,
73+
"allow-plugins": false
7474
}
7575
}

src/bundle/AppCache.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\Bundle\HttpCache;
89

910
use FOS\HttpCache\SymfonyCache\CacheInvalidation;

src/bundle/Controller/InvalidateTokenController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\Bundle\HttpCache\Controller;
89

910
use FOS\HttpCache\ResponseTagger;

src/bundle/DependencyInjection/Compiler/DriverPass.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\Bundle\HttpCache\DependencyInjection\Compiler;
89

910
use Ibexa\Contracts\HttpCache\Handler\ContentTagInterface;

src/bundle/DependencyInjection/Compiler/KernelPass.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\Bundle\HttpCache\DependencyInjection\Compiler;
89

910
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;

src/bundle/DependencyInjection/Compiler/ResponseTaggersPass.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\Bundle\HttpCache\DependencyInjection\Compiler;
89

910
use Ibexa\HttpCache\ResponseTagger\Delegator\DispatcherTagger;

src/bundle/DependencyInjection/Compiler/VarnishCachePass.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\Bundle\HttpCache\DependencyInjection\Compiler;
89

910
use InvalidArgumentException;

src/bundle/DependencyInjection/ConfigResolver/HttpCacheConfigParser.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\Bundle\HttpCache\DependencyInjection\ConfigResolver;
89

910
use Ibexa\Bundle\Core\DependencyInjection\Configuration\ParserInterface;

src/bundle/DependencyInjection/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\Bundle\HttpCache\DependencyInjection;
89

910
use Symfony\Component\Config\Definition\Builder\TreeBuilder;

src/bundle/DependencyInjection/IbexaHttpCacheExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\Bundle\HttpCache\DependencyInjection;
89

910
use FOS\HttpCache\TagHeaderFormatter\TagHeaderFormatter;

src/bundle/IbexaHttpCacheBundle.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\Bundle\HttpCache;
89

910
use Ibexa\Bundle\HttpCache\DependencyInjection\Compiler\DriverPass;

src/contracts/Handler/ContentTagInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\Contracts\HttpCache\Handler;
89

910
interface ContentTagInterface

src/contracts/PurgeClient/PurgeClientInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\Contracts\HttpCache\PurgeClient;
89

910
/**

src/contracts/ResponseTagger/ResponseTagger.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\Contracts\HttpCache\ResponseTagger;
89

910
/**

src/lib/ContextProvider/RoleIdentify.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\ContextProvider;
89

910
use FOS\HttpCache\UserContext\ContextProvider;

src/lib/EventListener/ConditionallyRemoveVaryHeaderListener.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\EventListener;
89

910
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

src/lib/EventSubscriber/HiddenLocationExceptionSubscriber.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\EventSubscriber;
89

910
use Ibexa\Core\MVC\Exception\HiddenLocationException;

src/lib/EventSubscriber/HttpCacheResponseSubscriber.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\EventSubscriber;
89

910
use Ibexa\Contracts\HttpCache\ResponseTagger\ResponseTagger;

src/lib/EventSubscriber/RestKernelViewSubscriber.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\EventSubscriber;
89

910
use FOS\HttpCache\ResponseTagger;

src/lib/EventSubscriber/UserContextSubscriber.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\EventSubscriber;
89

910
use FOS\HttpCache\TagHeaderFormatter\TagHeaderFormatter;

src/lib/EventSubscriber/XLocationIdResponseSubscriber.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\EventSubscriber;
89

910
use FOS\HttpCache\ResponseTagger;

src/lib/Handler/TagHandler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\Handler;
89

910
use FOS\HttpCacheBundle\Http\SymfonyResponseTagger;

src/lib/Proxy/UserContextListener.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\Proxy;
89

910
use FOS\HttpCache\SymfonyCache\UserContextListener as BaseUserContextListener;

src/lib/PurgeClient/LocalPurgeClient.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\PurgeClient;
89

910
use Ibexa\Contracts\HttpCache\PurgeClient\PurgeClientInterface;

src/lib/PurgeClient/RepositoryPrefixDecorator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\PurgeClient;
89

910
use Ibexa\Contracts\HttpCache\PurgeClient\PurgeClientInterface;

src/lib/PurgeClient/VarnishPurgeClient.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\PurgeClient;
89

910
use FOS\HttpCacheBundle\CacheManager;

src/lib/RepositoryTagPrefix.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache;
89

910
use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface;

src/lib/ResponseConfigurator/ResponseCacheConfigurator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\ResponseConfigurator;
89

910
use Symfony\Component\HttpFoundation\Response;

src/lib/ResponseTagger/Delegator/ContentValueViewTagger.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\ResponseTagger\Delegator;
89

910
use Ibexa\Contracts\Core\Repository\Values\Content\Content;

src/lib/ResponseTagger/Delegator/DispatcherTagger.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\ResponseTagger\Delegator;
89

910
use Ibexa\Contracts\HttpCache\ResponseTagger\ResponseTagger;

src/lib/ResponseTagger/Delegator/LocationValueViewTagger.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\ResponseTagger\Delegator;
89

910
use Ibexa\Contracts\Core\Repository\Values\Content\Location;

src/lib/ResponseTagger/Value/AbstractValueTagger.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\ResponseTagger\Value;
89

910
use FOS\HttpCache\ResponseTagger as FosResponseTagger;

src/lib/ResponseTagger/Value/ContentInfoTagger.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\ResponseTagger\Value;
89

910
use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo;

src/lib/ResponseTagger/Value/LocationTagger.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\ResponseTagger\Value;
89

910
use Ibexa\Contracts\Core\Repository\Values\Content\Location;

src/lib/Twig/ContentTaggingExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\HttpCache\Twig;
89

910
use Ibexa\Contracts\Core\Repository\Values\Content\Location;

tests/bundle/EventListener/ConditionallyRemoveVaryHeaderListenerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\Tests\Bundle\HttpCache\EventListener;
89

910
use Ibexa\HttpCache\EventListener\ConditionallyRemoveVaryHeaderListener;

tests/lib/ContextProvider/RoleIdentifyTest.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\Tests\HttpCache\ContextProvider;
89

910
use FOS\HttpCache\UserContext\UserContext;
@@ -46,7 +47,7 @@ protected function setUp(): void
4647
$this->roleServiceMock = $this->createMock(RoleService::class);
4748

4849
$this->repositoryMock
49-
->expects($this->any())
50+
->expects(self::any())
5051
->method('getRoleService')
5152
->willReturn($this->roleServiceMock);
5253
}
@@ -63,7 +64,7 @@ public function testSetIdentity()
6364
->willReturn($userReference);
6465

6566
$this->repositoryMock
66-
->expects($this->any())
67+
->expects(self::any())
6768
->method('getPermissionResolver')
6869
->willReturn($permissionResolver);
6970

@@ -118,25 +119,25 @@ public function testSetIdentity()
118119
];
119120

120121
$this->roleServiceMock
121-
->expects($this->once())
122+
->expects(self::once())
122123
->method('getRoleAssignmentsForUser')
123124
->with($user, true)
124125
->willReturn($returnedRoleAssignments);
125126

126-
$this->assertSame([], $userContext->getParameters());
127+
self::assertSame([], $userContext->getParameters());
127128
$contextProvider = new RoleIdentify(
128129
$this->repositoryMock,
129130
$permissionResolver,
130131
$userService
131132
);
132133
$contextProvider->updateUserContext($userContext);
133134
$userContextParams = $userContext->getParameters();
134-
$this->assertArrayHasKey('roleIdList', $userContextParams);
135-
$this->assertSame([$roleId1, $roleId2, $roleId3], $userContextParams['roleIdList']);
136-
$this->assertArrayHasKey('roleLimitationList', $userContextParams);
135+
self::assertArrayHasKey('roleIdList', $userContextParams);
136+
self::assertSame([$roleId1, $roleId2, $roleId3], $userContextParams['roleIdList']);
137+
self::assertArrayHasKey('roleLimitationList', $userContextParams);
137138
$limitationIdentifierForRole2 = \get_class($limitationForRole2);
138139
$limitationIdentifierForRole3 = \get_class($limitationForRole3);
139-
$this->assertSame(
140+
self::assertSame(
140141
[
141142
"$roleId2-$limitationIdentifierForRole2" => ['/1/2', '/1/2/43'],
142143
"$roleId3-$limitationIdentifierForRole3" => ['foo', 'bar'],
@@ -168,7 +169,7 @@ private function generateLimitationMock(array $properties = [])
168169
->setConstructorArgs([$properties])
169170
->getMockForAbstractClass();
170171
$limitationMock
171-
->expects($this->any())
172+
->expects(self::any())
172173
->method('getIdentifier')
173174
->willReturn(\get_class($limitationMock));
174175

tests/lib/PurgeClient/LocalPurgeClientTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
78
namespace Ibexa\Tests\HttpCache\PurgeClient;
89

910
use Ibexa\HttpCache\PurgeClient\LocalPurgeClient;
@@ -31,7 +32,7 @@ static function ($id) {
3132
);
3233

3334
$this->store
34-
->expects($this->once())
35+
->expects(self::once())
3536
->method('invalidateTags')
3637
->with($keys);
3738

0 commit comments

Comments
 (0)