diff --git a/composer.json b/composer.json index 0654127..bbd8992 100644 --- a/composer.json +++ b/composer.json @@ -30,11 +30,10 @@ "twig/twig": "^3.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.0", - "ibexa/code-style": "^1.0", + "ibexa/code-style": "~2.0.0", "ibexa/doctrine-schema": "~5.0.x-dev", "mikey179/vfsstream": "^1.6", - "phpunit/phpunit": "^8.1" + "phpunit/phpunit": "^9.6" }, "autoload": { "psr-4": { diff --git a/phpunit.xml b/phpunit.xml index f1881ce..f2eacb8 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -2,29 +2,14 @@ + > - ./tests + ./tests - - - - ./ - - tests/ - vendor/ - - - - diff --git a/src/bundle/DataCollector/TwigDataCollector.php b/src/bundle/DataCollector/TwigDataCollector.php index 270cb60..2a2477e 100644 --- a/src/bundle/DataCollector/TwigDataCollector.php +++ b/src/bundle/DataCollector/TwigDataCollector.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\DesignEngine\DataCollector; use Ibexa\DesignEngine\Templating\TemplatePathRegistryInterface; diff --git a/src/bundle/DependencyInjection/Compiler/AssetPathResolutionPass.php b/src/bundle/DependencyInjection/Compiler/AssetPathResolutionPass.php index f8e8858..f0dcf9f 100644 --- a/src/bundle/DependencyInjection/Compiler/AssetPathResolutionPass.php +++ b/src/bundle/DependencyInjection/Compiler/AssetPathResolutionPass.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\DesignEngine\DependencyInjection\Compiler; use Ibexa\DesignEngine\Asset\AssetPathProvisionerInterface; diff --git a/src/bundle/DependencyInjection/Compiler/AssetThemePass.php b/src/bundle/DependencyInjection/Compiler/AssetThemePass.php index 78a34e4..08d2db1 100644 --- a/src/bundle/DependencyInjection/Compiler/AssetThemePass.php +++ b/src/bundle/DependencyInjection/Compiler/AssetThemePass.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\DesignEngine\DependencyInjection\Compiler; use Ibexa\Contracts\DesignEngine\DesignAwareInterface; diff --git a/src/bundle/DependencyInjection/Compiler/TwigThemePass.php b/src/bundle/DependencyInjection/Compiler/TwigThemePass.php index 7e5947c..ffea8ab 100644 --- a/src/bundle/DependencyInjection/Compiler/TwigThemePass.php +++ b/src/bundle/DependencyInjection/Compiler/TwigThemePass.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\DesignEngine\DependencyInjection\Compiler; use Ibexa\Bundle\DesignEngine\DataCollector\TwigDataCollector; diff --git a/src/bundle/DependencyInjection/Configuration.php b/src/bundle/DependencyInjection/Configuration.php index be9fbc3..3b33b36 100644 --- a/src/bundle/DependencyInjection/Configuration.php +++ b/src/bundle/DependencyInjection/Configuration.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\DesignEngine\DependencyInjection; use Ibexa\Bundle\Core\DependencyInjection\Configuration\SiteAccessAware\Configuration as SiteAccessConfiguration; diff --git a/src/bundle/DependencyInjection/DesignConfigParser.php b/src/bundle/DependencyInjection/DesignConfigParser.php index c31a7d0..b190aa6 100644 --- a/src/bundle/DependencyInjection/DesignConfigParser.php +++ b/src/bundle/DependencyInjection/DesignConfigParser.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\DesignEngine\DependencyInjection; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ParserInterface; diff --git a/src/bundle/DependencyInjection/IbexaDesignEngineExtension.php b/src/bundle/DependencyInjection/IbexaDesignEngineExtension.php index 43b5549..3a2dea2 100644 --- a/src/bundle/DependencyInjection/IbexaDesignEngineExtension.php +++ b/src/bundle/DependencyInjection/IbexaDesignEngineExtension.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\DesignEngine\DependencyInjection; use Ibexa\Bundle\Core\DependencyInjection\Configuration\SiteAccessAware\ConfigurationProcessor; diff --git a/src/bundle/IbexaDesignEngineBundle.php b/src/bundle/IbexaDesignEngineBundle.php index dde81f2..59f3dcb 100644 --- a/src/bundle/IbexaDesignEngineBundle.php +++ b/src/bundle/IbexaDesignEngineBundle.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\DesignEngine; use Ibexa\Bundle\DesignEngine\DependencyInjection\Compiler\AssetPathResolutionPass; diff --git a/src/contracts/DesignAwareInterface.php b/src/contracts/DesignAwareInterface.php index 047c147..463e23e 100644 --- a/src/contracts/DesignAwareInterface.php +++ b/src/contracts/DesignAwareInterface.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Contracts\DesignEngine; interface DesignAwareInterface diff --git a/src/lib/Asset/AssetPathProvisionerInterface.php b/src/lib/Asset/AssetPathProvisionerInterface.php index 2a518da..b0a3e2b 100644 --- a/src/lib/Asset/AssetPathProvisionerInterface.php +++ b/src/lib/Asset/AssetPathProvisionerInterface.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\DesignEngine\Asset; interface AssetPathProvisionerInterface diff --git a/src/lib/Asset/AssetPathResolver.php b/src/lib/Asset/AssetPathResolver.php index 9f11e47..1543bae 100644 --- a/src/lib/Asset/AssetPathResolver.php +++ b/src/lib/Asset/AssetPathResolver.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\DesignEngine\Asset; use Ibexa\DesignEngine\Exception\InvalidDesignException; diff --git a/src/lib/Asset/AssetPathResolverInterface.php b/src/lib/Asset/AssetPathResolverInterface.php index 6c46d8f..fb5f958 100644 --- a/src/lib/Asset/AssetPathResolverInterface.php +++ b/src/lib/Asset/AssetPathResolverInterface.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\DesignEngine\Asset; /** diff --git a/src/lib/Asset/ProvisionedPathResolver.php b/src/lib/Asset/ProvisionedPathResolver.php index 5b6b516..ce77a36 100644 --- a/src/lib/Asset/ProvisionedPathResolver.php +++ b/src/lib/Asset/ProvisionedPathResolver.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\DesignEngine\Asset; use Symfony\Component\Finder\Finder; diff --git a/src/lib/Asset/ThemePackage.php b/src/lib/Asset/ThemePackage.php index fcca837..261ec2e 100644 --- a/src/lib/Asset/ThemePackage.php +++ b/src/lib/Asset/ThemePackage.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\DesignEngine\Asset; use Ibexa\Contracts\DesignEngine\DesignAwareInterface; diff --git a/src/lib/DesignAwareTrait.php b/src/lib/DesignAwareTrait.php index ae5f351..8ef6bdc 100644 --- a/src/lib/DesignAwareTrait.php +++ b/src/lib/DesignAwareTrait.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\DesignEngine; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/lib/Exception/InvalidDesignException.php b/src/lib/Exception/InvalidDesignException.php index 3d63936..cf1d125 100644 --- a/src/lib/Exception/InvalidDesignException.php +++ b/src/lib/Exception/InvalidDesignException.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\DesignEngine\Exception; use InvalidArgumentException; diff --git a/src/lib/Templating/TemplateNameResolverInterface.php b/src/lib/Templating/TemplateNameResolverInterface.php index 55c773f..a15af89 100644 --- a/src/lib/Templating/TemplateNameResolverInterface.php +++ b/src/lib/Templating/TemplateNameResolverInterface.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\DesignEngine\Templating; use Ibexa\Contracts\DesignEngine\DesignAwareInterface; diff --git a/src/lib/Templating/TemplatePathRegistry.php b/src/lib/Templating/TemplatePathRegistry.php index a47006b..a28f174 100644 --- a/src/lib/Templating/TemplatePathRegistry.php +++ b/src/lib/Templating/TemplatePathRegistry.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\DesignEngine\Templating; use Serializable; diff --git a/src/lib/Templating/TemplatePathRegistryInterface.php b/src/lib/Templating/TemplatePathRegistryInterface.php index b14326e..1eaaca5 100644 --- a/src/lib/Templating/TemplatePathRegistryInterface.php +++ b/src/lib/Templating/TemplatePathRegistryInterface.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\DesignEngine\Templating; /** diff --git a/src/lib/Templating/ThemeTemplateNameResolver.php b/src/lib/Templating/ThemeTemplateNameResolver.php index 2d99078..31cc984 100644 --- a/src/lib/Templating/ThemeTemplateNameResolver.php +++ b/src/lib/Templating/ThemeTemplateNameResolver.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\DesignEngine\Templating; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/lib/Templating/Twig/TwigThemeLoader.php b/src/lib/Templating/Twig/TwigThemeLoader.php index 7c919b0..81af5f7 100644 --- a/src/lib/Templating/Twig/TwigThemeLoader.php +++ b/src/lib/Templating/Twig/TwigThemeLoader.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\DesignEngine\Templating\Twig; use Ibexa\DesignEngine\Templating\TemplateNameResolverInterface; diff --git a/tests/lib/Asset/AssetPathResolverTest.php b/tests/lib/Asset/AssetPathResolverTest.php index 6582bc5..8545ca7 100644 --- a/tests/lib/Asset/AssetPathResolverTest.php +++ b/tests/lib/Asset/AssetPathResolverTest.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Tests\DesignEngine\Asset; use Ibexa\DesignEngine\Asset\AssetPathResolver; @@ -18,7 +19,7 @@ public function testResolveAssetPathFail() { $logger = $this->createMock(LoggerInterface::class); $logger - ->expects($this->once()) + ->expects(self::once()) ->method('warning'); $resolver = new AssetPathResolver(['foo' => []], __DIR__, $logger); diff --git a/tests/lib/Asset/ProvisionedPathResolverTest.php b/tests/lib/Asset/ProvisionedPathResolverTest.php index 1a60dd6..683b385 100644 --- a/tests/lib/Asset/ProvisionedPathResolverTest.php +++ b/tests/lib/Asset/ProvisionedPathResolverTest.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Tests\DesignEngine\Asset; use Ibexa\DesignEngine\Asset\AssetPathResolver; @@ -37,7 +38,7 @@ public function testResolvePathNotProvisioned() $design = 'foo'; $expected = 'some/path/images/some_image.jpg'; $this->innerResolver - ->expects($this->once()) + ->expects(self::once()) ->method('resolveAssetPath') ->with($assetLogicalPath, $design) ->willReturn($expected); diff --git a/tests/lib/Asset/ThemePackageTest.php b/tests/lib/Asset/ThemePackageTest.php index ecdddfc..aecfac8 100644 --- a/tests/lib/Asset/ThemePackageTest.php +++ b/tests/lib/Asset/ThemePackageTest.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Tests\DesignEngine\Asset; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; @@ -45,12 +46,12 @@ public function testGetUrl() $currentDesign = 'foo'; $this->assetPathResolver - ->expects($this->once()) + ->expects(self::once()) ->method('resolveAssetPath') ->with($assetPath, $currentDesign) ->willReturn($fullAssetPath); $this->innerPackage - ->expects($this->once()) + ->expects(self::once()) ->method('getUrl') ->with($fullAssetPath) ->willReturn("/$fullAssetPath"); @@ -71,13 +72,13 @@ public function testGetVersion() $currentDesign = 'foo'; $this->assetPathResolver - ->expects($this->once()) + ->expects(self::once()) ->method('resolveAssetPath') ->with($assetPath, $currentDesign) ->willReturn($fullAssetPath); $version = 'v1'; $this->innerPackage - ->expects($this->once()) + ->expects(self::once()) ->method('getVersion') ->with($fullAssetPath) ->willReturn($version); diff --git a/tests/lib/Templating/TemplatePathRegistryTest.php b/tests/lib/Templating/TemplatePathRegistryTest.php index c77f23c..509ce38 100644 --- a/tests/lib/Templating/TemplatePathRegistryTest.php +++ b/tests/lib/Templating/TemplatePathRegistryTest.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Tests\DesignEngine\Templating; use Ibexa\DesignEngine\Templating\TemplatePathRegistry; diff --git a/tests/lib/Templating/ThemeTemplateNameResolverTest.php b/tests/lib/Templating/ThemeTemplateNameResolverTest.php index f8d66b2..aec33c3 100644 --- a/tests/lib/Templating/ThemeTemplateNameResolverTest.php +++ b/tests/lib/Templating/ThemeTemplateNameResolverTest.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Tests\DesignEngine\Templating; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface;