diff --git a/.github/workflows/coding_standard.yaml b/.github/workflows/coding_standard.yaml index eb5fd8a..a47fce6 100644 --- a/.github/workflows/coding_standard.yaml +++ b/.github/workflows/coding_standard.yaml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: [ 7.4, 8.0, 8.1 ] + php-versions: [ 8.1 ] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/php_linter.yaml b/.github/workflows/php_linter.yaml index 816ebc7..15aaee1 100644 --- a/.github/workflows/php_linter.yaml +++ b/.github/workflows/php_linter.yaml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: [ 7.4, 8.0, 8.1 ] + php-versions: [ 8.1, 8.2, 8.3 ] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/phpstan.yaml b/.github/workflows/phpstan.yaml index 89112d9..b65040b 100644 --- a/.github/workflows/phpstan.yaml +++ b/.github/workflows/phpstan.yaml @@ -18,7 +18,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.1 coverage: none env: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5368f3e..64baeba 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -16,9 +16,8 @@ jobs: strategy: matrix: typo3-php-versions: - - { typo3: 10, php: 7.4 } - - { typo3: 11, php: 7.4 } - { typo3: 12, php: 8.1 } + - { typo3: 13, php: 8.1 } name: "Run tests with PHP ${{ matrix.typo3-php-versions.php }} using TYPO3 ${{ matrix.typo3-php-versions.typo3 }}" steps: diff --git a/Build/FunctionalTests.xml b/Build/FunctionalTests.xml index 4f3bb64..bcdc8bb 100644 --- a/Build/FunctionalTests.xml +++ b/Build/FunctionalTests.xml @@ -1,13 +1,13 @@ - - - - ../Classes/ - - + ../Tests/Functional/ + + + ../Classes/ + + diff --git a/Build/UnitTests.xml b/Build/UnitTests.xml index 284f158..14594fb 100644 --- a/Build/UnitTests.xml +++ b/Build/UnitTests.xml @@ -1,13 +1,13 @@ - - - - ../Classes/ - - + ../Tests/Unit/ + + + ../Classes/ + + diff --git a/Classes/Asset/EntrypointLookup.php b/Classes/Asset/EntrypointLookup.php index 85d4416..af41b19 100644 --- a/Classes/Asset/EntrypointLookup.php +++ b/Classes/Asset/EntrypointLookup.php @@ -20,26 +20,20 @@ final class EntrypointLookup implements EntrypointLookupInterface, IntegrityData { private ?array $entriesData = null; - private string $entrypointJsonPath; + private readonly string $entrypointJsonPath; private array $returnedFiles = []; - private JsonDecoderInterface $jsonDecoder; - - private FilesystemInterface $filesystem; - - private bool $strictMode; + private readonly FilesystemInterface $filesystem; public function __construct( string $entrypointJsonPath, - bool $strictMode, - JsonDecoderInterface $jsonDecoder, + private readonly bool $strictMode, + private readonly JsonDecoderInterface $jsonDecoder, FilesystemInterface $filesystem ) { $this->entrypointJsonPath = $filesystem->getFileAbsFileName($entrypointJsonPath); - $this->jsonDecoder = $jsonDecoder; $this->filesystem = $filesystem; - $this->strictMode = $strictMode; } public function getJavaScriptFiles(string $entryName): array @@ -127,7 +121,7 @@ private function getEntriesData(): array try { $this->entriesData = $this->jsonDecoder->decode($this->filesystem->get($this->entrypointJsonPath)); - } catch (JsonDecodeException $e) { + } catch (JsonDecodeException) { throw new InvalidArgumentException(sprintf( 'There was a problem JSON decoding the "%s" file', $this->entrypointJsonPath diff --git a/Classes/Asset/EntrypointLookupCollection.php b/Classes/Asset/EntrypointLookupCollection.php index 9afd53c..33132f5 100644 --- a/Classes/Asset/EntrypointLookupCollection.php +++ b/Classes/Asset/EntrypointLookupCollection.php @@ -15,19 +15,15 @@ class EntrypointLookupCollection implements EntrypointLookupCollectionInterface { - private EntryLookupFactoryInterface $entryLookupFactory; - /** * @var array|EntrypointLookupInterface[] */ private ?array $buildEntrypoints = null; - private ?string $defaultBuildName; - - public function __construct(EntryLookupFactoryInterface $entryLookupFactory, string $defaultBuildName = null) - { - $this->entryLookupFactory = $entryLookupFactory; - $this->defaultBuildName = $defaultBuildName; + public function __construct( + private readonly EntryLookupFactoryInterface $entryLookupFactory, + private readonly ?string $defaultBuildName = null + ) { } public function getEntrypointLookup(string $buildName = null): EntrypointLookupInterface diff --git a/Classes/Asset/TagRenderer.php b/Classes/Asset/TagRenderer.php index 99f92ca..ea36dcc 100644 --- a/Classes/Asset/TagRenderer.php +++ b/Classes/Asset/TagRenderer.php @@ -25,15 +25,11 @@ final class TagRenderer implements TagRendererInterface { - private EntrypointLookupCollectionInterface $entrypointLookupCollection; - - private AssetRegistryInterface $assetRegistry; - private ?ApplicationType $applicationType = null; public function __construct( - EntrypointLookupCollectionInterface $entrypointLookupCollection, - AssetRegistryInterface $assetRegistry + private readonly EntrypointLookupCollectionInterface $entrypointLookupCollection, + private readonly AssetRegistryInterface $assetRegistry ) { try { $this->applicationType = array_key_exists( @@ -42,12 +38,9 @@ public function __construct( ) && $GLOBALS['TYPO3_REQUEST'] instanceof ServerRequestInterface ? ApplicationType::fromRequest( $GLOBALS['TYPO3_REQUEST'] ) : null; - } catch (RuntimeException $e) { + } catch (RuntimeException) { $this->applicationType = null; } - - $this->entrypointLookupCollection = $entrypointLookupCollection; - $this->assetRegistry = $assetRegistry; } public function renderWebpackScriptTags(ScriptTag $scriptTag): void @@ -71,7 +64,7 @@ public function renderWebpackScriptTags(ScriptTag $scriptTag): void // To do this, it's split up into two parts. The first part wraps the first file // and the second part wraps the last file. $splitChar = ! empty($parameters['splitChar']) ? $parameters['splitChar'] : '|'; - $wrapArr = explode($splitChar, $parameters['allWrap'], 2); + $wrapArr = explode($splitChar, (string) $parameters['allWrap'], 2); $wrapFirst = $wrapArr[0] . $splitChar; $wrapLast = $splitChar . $wrapArr[1]; unset($parameters['allWrap']); @@ -93,7 +86,7 @@ public function renderWebpackScriptTags(ScriptTag $scriptTag): void } $attributes = array_replace([ - 'file' => $this->removeLeadingSlash($file, $parameters) ? ltrim($file, '/') : $file, + 'file' => $this->removeLeadingSlash($file, $parameters) ? ltrim((string) $file, '/') : $file, 'type' => $this->removeType($parameters) ? '' : 'text/javascript', 'compress' => false, 'forceOnTop' => false, @@ -112,7 +105,7 @@ public function renderWebpackScriptTags(ScriptTag $scriptTag): void if ($scriptTag->isLibrary()) { $pageRendererMethodName .= 'Library'; - $filename = basename($file); + $filename = basename((string) $file); $pageRenderer->{$pageRendererMethodName}($filename, ...$attributes); } else { $pageRendererMethodName .= 'File'; @@ -146,7 +139,7 @@ public function renderWebpackLinkTags(LinkTag $linkTag): void // To do this, it's split up into two parts. The first part wraps the first file // and the second part wraps the last file. $splitChar = ! empty($parameters['splitChar']) ? $parameters['splitChar'] : '|'; - $wrapArr = explode($splitChar, $parameters['allWrap'], 2); + $wrapArr = explode($splitChar, (string) $parameters['allWrap'], 2); $wrapFirst = $wrapArr[0] . $splitChar; $wrapLast = $splitChar . $wrapArr[1]; unset($parameters['allWrap']); @@ -165,7 +158,7 @@ public function renderWebpackLinkTags(LinkTag $linkTag): void } $attributes = array_replace([ - 'file' => $this->removeLeadingSlash($file, $parameters) ? ltrim($file, '/') : $file, + 'file' => $this->removeLeadingSlash($file, $parameters) ? ltrim((string) $file, '/') : $file, 'rel' => 'stylesheet', 'media' => $linkTag->getMedia(), 'title' => '', diff --git a/Classes/Form/FormDataProvider/RichtextEncoreConfiguration.php b/Classes/Form/FormDataProvider/RichtextEncoreConfiguration.php index 59224cf..57d5761 100644 --- a/Classes/Form/FormDataProvider/RichtextEncoreConfiguration.php +++ b/Classes/Form/FormDataProvider/RichtextEncoreConfiguration.php @@ -19,7 +19,7 @@ final class RichtextEncoreConfiguration implements FormDataProviderInterface { - private EntrypointLookupCollectionInterface $entrypointLookupCollection; + private readonly EntrypointLookupCollectionInterface $entrypointLookupCollection; public function __construct(EntrypointLookupCollectionInterface $entrypointLookupCollection = null) { diff --git a/Classes/Integration/AssetRegistry.php b/Classes/Integration/AssetRegistry.php index e9cd245..c0bbddf 100644 --- a/Classes/Integration/AssetRegistry.php +++ b/Classes/Integration/AssetRegistry.php @@ -20,11 +20,9 @@ final class AssetRegistry implements AssetRegistryInterface private array $defaultAttributes = []; - private SettingsServiceInterface $settingsService; - - public function __construct(SettingsServiceInterface $settingsService) - { - $this->settingsService = $settingsService; + public function __construct( + private readonly SettingsServiceInterface $settingsService + ) { $this->reset(); } diff --git a/Classes/Integration/EntryLookupFactory.php b/Classes/Integration/EntryLookupFactory.php index 3f80deb..976ba9e 100644 --- a/Classes/Integration/EntryLookupFactory.php +++ b/Classes/Integration/EntryLookupFactory.php @@ -16,25 +16,16 @@ final class EntryLookupFactory implements EntryLookupFactoryInterface { - private SettingsServiceInterface $settingsService; - - private FilesystemInterface $filesystem; - /** * @var array|EntrypointLookupInterface[] */ private static ?array $collection = null; - private JsonDecoderInterface $jsonDecoder; - public function __construct( - SettingsServiceInterface $settingsService, - FilesystemInterface $filesystem, - JsonDecoderInterface $jsonDecoder + private readonly SettingsServiceInterface $settingsService, + private readonly FilesystemInterface $filesystem, + private readonly JsonDecoderInterface $jsonDecoder ) { - $this->settingsService = $settingsService; - $this->filesystem = $filesystem; - $this->jsonDecoder = $jsonDecoder; } /** diff --git a/Classes/Integration/FixedIdGenerator.php b/Classes/Integration/FixedIdGenerator.php index d29d59d..e37d937 100644 --- a/Classes/Integration/FixedIdGenerator.php +++ b/Classes/Integration/FixedIdGenerator.php @@ -13,11 +13,9 @@ final class FixedIdGenerator implements IdGeneratorInterface { - private string $id; - - public function __construct(string $id) - { - $this->id = $id; + public function __construct( + private readonly string $id + ) { } public function generate(): string diff --git a/Classes/Integration/PackageFactory.php b/Classes/Integration/PackageFactory.php index 8292d98..90c578b 100644 --- a/Classes/Integration/PackageFactory.php +++ b/Classes/Integration/PackageFactory.php @@ -18,14 +18,10 @@ final class PackageFactory implements PackageFactoryInterface { - private SettingsServiceInterface $settingsService; - - private FilesystemInterface $filesystem; - - public function __construct(SettingsServiceInterface $settingsService, FilesystemInterface $filesystem) - { - $this->settingsService = $settingsService; - $this->filesystem = $filesystem; + public function __construct( + private readonly SettingsServiceInterface $settingsService, + private readonly FilesystemInterface $filesystem + ) { } public function getPackage(string $package): JsonPackage diff --git a/Classes/Integration/PageRendererHooks.php b/Classes/Integration/PageRendererHooks.php index 2681dc0..be1d321 100644 --- a/Classes/Integration/PageRendererHooks.php +++ b/Classes/Integration/PageRendererHooks.php @@ -30,11 +30,9 @@ final class PageRendererHooks */ private const PART_FOOTER = 2; - private TagRendererInterface $tagRenderer; - - public function __construct(TagRendererInterface $tagRenderer) - { - $this->tagRenderer = $tagRenderer; + public function __construct( + private readonly TagRendererInterface $tagRenderer + ) { } public function renderPreProcess(array $params, PageRenderer $pageRenderer): void diff --git a/Classes/Integration/SettingsService.php b/Classes/Integration/SettingsService.php index 3bb9fcd..84443f9 100644 --- a/Classes/Integration/SettingsService.php +++ b/Classes/Integration/SettingsService.php @@ -18,11 +18,9 @@ final class SettingsService implements SettingsServiceInterface { private ?array $settings = null; - private ConfigurationManagerInterface $configurationManager; - - public function __construct(ConfigurationManagerInterface $configurationManager) - { - $this->configurationManager = $configurationManager; + public function __construct( + private readonly ConfigurationManagerInterface $configurationManager + ) { } public function getSettings(): array diff --git a/Classes/Integration/TypoScriptFrontendControllerEventListener.php b/Classes/Integration/TypoScriptFrontendControllerEventListener.php new file mode 100644 index 0000000..ece7cb0 --- /dev/null +++ b/Classes/Integration/TypoScriptFrontendControllerEventListener.php @@ -0,0 +1,38 @@ +assetRegistry->getRegisteredFiles(); + if ($registeredFiles === []) { + return; + } + + $event->getController() + ->config['encore_asset_registry'] = [ + 'registered_files' => $this->assetRegistry->getRegisteredFiles(), + 'default_attributes' => $this->assetRegistry->getDefaultAttributes(), + 'settings' => $this->settingsService->getSettings(), + ]; + } +} diff --git a/Classes/Integration/TypoScriptFrontendControllerHooks.php b/Classes/Integration/TypoScriptFrontendControllerHooks.php deleted file mode 100644 index 556c170..0000000 --- a/Classes/Integration/TypoScriptFrontendControllerHooks.php +++ /dev/null @@ -1,47 +0,0 @@ -controller = $GLOBALS['TSFE']; - $this->settingsService = $settingsService; - $this->assetRegistry = $assetRegistry; - } - - public function contentPostProcAll(array $params, TypoScriptFrontendController $tsfe): void - { - $registeredFiles = $this->assetRegistry->getRegisteredFiles(); - if ($registeredFiles === []) { - return; - } - - $this->controller->config['encore_asset_registry'] = [ - 'registered_files' => $this->assetRegistry->getRegisteredFiles(), - 'default_attributes' => $this->assetRegistry->getDefaultAttributes(), - 'settings' => $this->settingsService->getSettings(), - ]; - } -} diff --git a/Classes/Middleware/AssetsMiddleware.php b/Classes/Middleware/AssetsMiddleware.php index 3e092a6..17602d8 100644 --- a/Classes/Middleware/AssetsMiddleware.php +++ b/Classes/Middleware/AssetsMiddleware.php @@ -37,15 +37,11 @@ final class AssetsMiddleware implements MiddlewareInterface */ private $controller; - private AssetRegistryInterface $assetRegistry; - - private SettingsServiceInterface $settingsService; - - public function __construct(AssetRegistryInterface $assetRegistry, SettingsServiceInterface $settingsService) - { + public function __construct( + private readonly AssetRegistryInterface $assetRegistry, + private readonly SettingsServiceInterface $settingsService + ) { $this->controller = $GLOBALS['TSFE']; - $this->settingsService = $settingsService; - $this->assetRegistry = $assetRegistry; } public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface diff --git a/Classes/ValueObject/File.php b/Classes/ValueObject/File.php index 5208ce6..c04620e 100644 --- a/Classes/ValueObject/File.php +++ b/Classes/ValueObject/File.php @@ -13,20 +13,12 @@ final class File { - private string $file; - - private array $attributes; - - private string $rel; - - private FileType $fileType; - - public function __construct(string $file, FileType $fileType, array $attributes = [], string $rel = 'preload') - { - $this->file = $file; - $this->attributes = $attributes; - $this->rel = $rel; - $this->fileType = $fileType; + public function __construct( + private readonly string $file, + private readonly FileType $fileType, + private readonly array $attributes = [], + private readonly string $rel = 'preload' + ) { } public function getFile(): string diff --git a/Classes/ValueObject/FileType.php b/Classes/ValueObject/FileType.php index 62c8258..067c751 100644 --- a/Classes/ValueObject/FileType.php +++ b/Classes/ValueObject/FileType.php @@ -30,7 +30,7 @@ final class FileType */ private const FONT = 'font'; - private string $type; + private readonly string $type; private function __construct(string $type) { diff --git a/Classes/ValueObject/JsonPackage.php b/Classes/ValueObject/JsonPackage.php index 5f9ee31..02593f1 100644 --- a/Classes/ValueObject/JsonPackage.php +++ b/Classes/ValueObject/JsonPackage.php @@ -15,14 +15,10 @@ final class JsonPackage { - private string $manifestJsonPath; - - private PackageInterface $package; - - public function __construct(string $manifestJsonPath, PackageInterface $package) - { - $this->manifestJsonPath = $manifestJsonPath; - $this->package = $package; + public function __construct( + private readonly string $manifestJsonPath, + private readonly PackageInterface $package + ) { } public function getManifestJsonPath(): string diff --git a/Classes/ValueObject/LinkTag.php b/Classes/ValueObject/LinkTag.php index f99bb62..d9666cf 100644 --- a/Classes/ValueObject/LinkTag.php +++ b/Classes/ValueObject/LinkTag.php @@ -16,32 +16,14 @@ final class LinkTag { - private string $entryName; - - private string $media; - - private string $buildName; - - private ?PageRenderer $pageRenderer; - - private array $parameters; - - private bool $registerFile; - public function __construct( - string $entryName, - string $media = 'all', - string $buildName = EntrypointLookupInterface::DEFAULT_BUILD, - PageRenderer $pageRenderer = null, - array $parameters = [], - bool $registerFile = true + private readonly string $entryName, + private readonly string $media = 'all', + private readonly string $buildName = EntrypointLookupInterface::DEFAULT_BUILD, + private readonly ?PageRenderer $pageRenderer = null, + private readonly array $parameters = [], + private readonly bool $registerFile = true ) { - $this->entryName = $entryName; - $this->media = $media; - $this->buildName = $buildName; - $this->pageRenderer = $pageRenderer; - $this->parameters = $parameters; - $this->registerFile = $registerFile; } public function getEntryName(): string diff --git a/Classes/ValueObject/ScriptTag.php b/Classes/ValueObject/ScriptTag.php index 14e0fe5..e747fbc 100644 --- a/Classes/ValueObject/ScriptTag.php +++ b/Classes/ValueObject/ScriptTag.php @@ -15,36 +15,15 @@ final class ScriptTag { - private string $entryName; - - private string $position; - - private string $buildName; - - private ?PageRenderer $pageRenderer; - - private array $parameters; - - private bool $registerFile; - - private bool $isLibrary; - public function __construct( - string $entryName, - string $position, - string $buildName, - PageRenderer $pageRenderer = null, - array $parameters = [], - bool $registerFile = true, - bool $isLibrary = false + private readonly string $entryName, + private readonly string $position, + private readonly string $buildName, + private readonly ?PageRenderer $pageRenderer = null, + private readonly array $parameters = [], + private readonly bool $registerFile = true, + private readonly bool $isLibrary = false ) { - $this->entryName = $entryName; - $this->position = $position; - $this->buildName = $buildName; - $this->pageRenderer = $pageRenderer; - $this->parameters = $parameters; - $this->registerFile = $registerFile; - $this->isLibrary = $isLibrary; } public function getEntryName(): string diff --git a/Classes/ViewHelpers/AssetViewHelper.php b/Classes/ViewHelpers/AssetViewHelper.php index 32dfce6..43c1abc 100644 --- a/Classes/ViewHelpers/AssetViewHelper.php +++ b/Classes/ViewHelpers/AssetViewHelper.php @@ -20,14 +20,10 @@ final class AssetViewHelper extends AbstractViewHelper { - private PackageFactoryInterface $packageFactory; - - private FilesystemInterface $filesystem; - - public function __construct(PackageFactoryInterface $packageFactory, FilesystemInterface $filesystem) - { - $this->packageFactory = $packageFactory; - $this->filesystem = $filesystem; + public function __construct( + private readonly PackageFactoryInterface $packageFactory, + private readonly FilesystemInterface $filesystem + ) { } public function initializeArguments(): void diff --git a/Classes/ViewHelpers/DnsPrefetchViewHelper.php b/Classes/ViewHelpers/DnsPrefetchViewHelper.php index 17c0144..79af210 100644 --- a/Classes/ViewHelpers/DnsPrefetchViewHelper.php +++ b/Classes/ViewHelpers/DnsPrefetchViewHelper.php @@ -18,11 +18,9 @@ final class DnsPrefetchViewHelper extends AbstractViewHelper { - private AssetRegistryInterface $assetRegistry; - - public function __construct(AssetRegistryInterface $assetRegistry) - { - $this->assetRegistry = $assetRegistry; + public function __construct( + private readonly AssetRegistryInterface $assetRegistry + ) { } public function initializeArguments(): void diff --git a/Classes/ViewHelpers/PreconnectViewHelper.php b/Classes/ViewHelpers/PreconnectViewHelper.php index b7c17e7..0a370f1 100644 --- a/Classes/ViewHelpers/PreconnectViewHelper.php +++ b/Classes/ViewHelpers/PreconnectViewHelper.php @@ -18,11 +18,9 @@ final class PreconnectViewHelper extends AbstractViewHelper { - private AssetRegistryInterface $assetRegistry; - - public function __construct(AssetRegistryInterface $assetRegistry) - { - $this->assetRegistry = $assetRegistry; + public function __construct( + private readonly AssetRegistryInterface $assetRegistry + ) { } public function initializeArguments(): void diff --git a/Classes/ViewHelpers/PrefetchViewHelper.php b/Classes/ViewHelpers/PrefetchViewHelper.php index 591cdc2..66eef63 100644 --- a/Classes/ViewHelpers/PrefetchViewHelper.php +++ b/Classes/ViewHelpers/PrefetchViewHelper.php @@ -18,11 +18,9 @@ final class PrefetchViewHelper extends AbstractViewHelper { - private AssetRegistryInterface $assetRegistry; - - public function __construct(AssetRegistryInterface $assetRegistry) - { - $this->assetRegistry = $assetRegistry; + public function __construct( + private readonly AssetRegistryInterface $assetRegistry + ) { } public function initializeArguments(): void diff --git a/Classes/ViewHelpers/PreloadViewHelper.php b/Classes/ViewHelpers/PreloadViewHelper.php index b4ceeee..8ddb208 100644 --- a/Classes/ViewHelpers/PreloadViewHelper.php +++ b/Classes/ViewHelpers/PreloadViewHelper.php @@ -18,11 +18,9 @@ final class PreloadViewHelper extends AbstractViewHelper { - private AssetRegistryInterface $assetRegistry; - - public function __construct(AssetRegistryInterface $assetRegistry) - { - $this->assetRegistry = $assetRegistry; + public function __construct( + private readonly AssetRegistryInterface $assetRegistry + ) { } public function initializeArguments(): void diff --git a/Classes/ViewHelpers/PrerenderViewHelper.php b/Classes/ViewHelpers/PrerenderViewHelper.php index 5569859..c2f6d13 100644 --- a/Classes/ViewHelpers/PrerenderViewHelper.php +++ b/Classes/ViewHelpers/PrerenderViewHelper.php @@ -18,11 +18,9 @@ final class PrerenderViewHelper extends AbstractViewHelper { - private AssetRegistryInterface $assetRegistry; - - public function __construct(AssetRegistryInterface $assetRegistry) - { - $this->assetRegistry = $assetRegistry; + public function __construct( + private readonly AssetRegistryInterface $assetRegistry + ) { } public function initializeArguments(): void diff --git a/Classes/ViewHelpers/RenderWebpackLinkTagsViewHelper.php b/Classes/ViewHelpers/RenderWebpackLinkTagsViewHelper.php index c25c2f4..8e5d6cf 100644 --- a/Classes/ViewHelpers/RenderWebpackLinkTagsViewHelper.php +++ b/Classes/ViewHelpers/RenderWebpackLinkTagsViewHelper.php @@ -18,11 +18,9 @@ final class RenderWebpackLinkTagsViewHelper extends AbstractViewHelper { - private TagRendererInterface $tagRenderer; - - public function __construct(TagRendererInterface $tagRenderer) - { - $this->tagRenderer = $tagRenderer; + public function __construct( + private readonly TagRendererInterface $tagRenderer + ) { } public function initializeArguments(): void diff --git a/Classes/ViewHelpers/RenderWebpackScriptTagsViewHelper.php b/Classes/ViewHelpers/RenderWebpackScriptTagsViewHelper.php index 20dce47..217df8e 100644 --- a/Classes/ViewHelpers/RenderWebpackScriptTagsViewHelper.php +++ b/Classes/ViewHelpers/RenderWebpackScriptTagsViewHelper.php @@ -18,11 +18,9 @@ final class RenderWebpackScriptTagsViewHelper extends AbstractViewHelper { - private TagRendererInterface $tagRenderer; - - public function __construct(TagRendererInterface $tagRenderer) - { - $this->tagRenderer = $tagRenderer; + public function __construct( + private readonly TagRendererInterface $tagRenderer + ) { } public function initializeArguments(): void diff --git a/Classes/ViewHelpers/Stimulus/Dto/AbstractStimulusDto.php b/Classes/ViewHelpers/Stimulus/Dto/AbstractStimulusDto.php index 35f908a..0810640 100644 --- a/Classes/ViewHelpers/Stimulus/Dto/AbstractStimulusDto.php +++ b/Classes/ViewHelpers/Stimulus/Dto/AbstractStimulusDto.php @@ -20,10 +20,7 @@ protected function getFormattedControllerName(string $controllerName): string return $this->escapeAsHtmlAttr($this->normalizeControllerName($controllerName)); } - /** - * @param mixed $value - */ - protected function getFormattedValue($value): string + protected function getFormattedValue(mixed $value): string { if ((\is_object($value) && \is_callable([$value, '__toString']))) { $value = (string) $value; diff --git a/Classes/ViewHelpers/Stimulus/Dto/StimulusActionsDto.php b/Classes/ViewHelpers/Stimulus/Dto/StimulusActionsDto.php index d1580a2..c8e2efb 100755 --- a/Classes/ViewHelpers/Stimulus/Dto/StimulusActionsDto.php +++ b/Classes/ViewHelpers/Stimulus/Dto/StimulusActionsDto.php @@ -11,7 +11,7 @@ namespace Ssch\Typo3Encore\ViewHelpers\Stimulus\Dto; -final class StimulusActionsDto extends AbstractStimulusDto +final class StimulusActionsDto extends AbstractStimulusDto implements \Stringable { private array $actions = []; diff --git a/Classes/ViewHelpers/Stimulus/Dto/StimulusControllersDto.php b/Classes/ViewHelpers/Stimulus/Dto/StimulusControllersDto.php index d20a50c..9295313 100644 --- a/Classes/ViewHelpers/Stimulus/Dto/StimulusControllersDto.php +++ b/Classes/ViewHelpers/Stimulus/Dto/StimulusControllersDto.php @@ -11,7 +11,7 @@ namespace Ssch\Typo3Encore\ViewHelpers\Stimulus\Dto; -class StimulusControllersDto extends AbstractStimulusDto +class StimulusControllersDto extends AbstractStimulusDto implements \Stringable { private array $controllers = []; diff --git a/Classes/ViewHelpers/Stimulus/Dto/StimulusTargetsDto.php b/Classes/ViewHelpers/Stimulus/Dto/StimulusTargetsDto.php index 2c9a06f..b103869 100755 --- a/Classes/ViewHelpers/Stimulus/Dto/StimulusTargetsDto.php +++ b/Classes/ViewHelpers/Stimulus/Dto/StimulusTargetsDto.php @@ -11,7 +11,7 @@ namespace Ssch\Typo3Encore\ViewHelpers\Stimulus\Dto; -final class StimulusTargetsDto extends AbstractStimulusDto +final class StimulusTargetsDto extends AbstractStimulusDto implements \Stringable { private array $targets = []; diff --git a/Classes/ViewHelpers/SvgViewHelper.php b/Classes/ViewHelpers/SvgViewHelper.php index 08dda96..4b00f89 100644 --- a/Classes/ViewHelpers/SvgViewHelper.php +++ b/Classes/ViewHelpers/SvgViewHelper.php @@ -33,21 +33,12 @@ class SvgViewHelper extends AbstractTagBasedViewHelper */ protected $tagName = 'svg'; - private IdGeneratorInterface $idGenerator; - - private FilesystemInterface $filesystem; - - private ImageService $imageService; - public function __construct( - FilesystemInterface $filesystem, - IdGeneratorInterface $idGenerator, - ImageService $imageService + private readonly FilesystemInterface $filesystem, + private readonly IdGeneratorInterface $idGenerator, + private readonly ImageService $imageService ) { parent::__construct(); - $this->filesystem = $filesystem; - $this->idGenerator = $idGenerator; - $this->imageService = $imageService; } public function initializeArguments(): void @@ -83,7 +74,7 @@ public function render(): string $imageUri = $this->imageService->getImageUri($image, (bool) $this->arguments['absolute']); $imageUri = GeneralUtility::createVersionNumberedFilename($imageUri); $imageContents = $image->getContents(); - } catch (FolderDoesNotExistException $folderDoesNotExistException) { + } catch (FolderDoesNotExistException) { $imageUri = $this->arguments['src']; $imageContents = $this->filesystem->get($imageUri); } diff --git a/Classes/ViewHelpers/WebpackCssFilesViewHelper.php b/Classes/ViewHelpers/WebpackCssFilesViewHelper.php index 9f83762..0851f32 100644 --- a/Classes/ViewHelpers/WebpackCssFilesViewHelper.php +++ b/Classes/ViewHelpers/WebpackCssFilesViewHelper.php @@ -17,11 +17,9 @@ final class WebpackCssFilesViewHelper extends AbstractViewHelper { - private EntrypointLookupCollectionInterface $entrypointLookupCollection; - - public function __construct(EntrypointLookupCollectionInterface $entrypointLookupCollection) - { - $this->entrypointLookupCollection = $entrypointLookupCollection; + public function __construct( + private readonly EntrypointLookupCollectionInterface $entrypointLookupCollection + ) { } public function initializeArguments(): void diff --git a/Classes/ViewHelpers/WebpackJsFilesViewHelper.php b/Classes/ViewHelpers/WebpackJsFilesViewHelper.php index ed17e0b..88f1cc9 100644 --- a/Classes/ViewHelpers/WebpackJsFilesViewHelper.php +++ b/Classes/ViewHelpers/WebpackJsFilesViewHelper.php @@ -17,11 +17,9 @@ final class WebpackJsFilesViewHelper extends AbstractViewHelper { - private EntrypointLookupCollectionInterface $entrypointLookupCollection; - - public function __construct(EntrypointLookupCollectionInterface $entrypointLookupCollection) - { - $this->entrypointLookupCollection = $entrypointLookupCollection; + public function __construct( + private readonly EntrypointLookupCollectionInterface $entrypointLookupCollection + ) { } public function initializeArguments(): void diff --git a/Configuration/Services.php b/Configuration/Services.php index 82cce9d..7bc4cb9 100644 --- a/Configuration/Services.php +++ b/Configuration/Services.php @@ -12,9 +12,11 @@ use Ssch\Typo3Encore\Integration\FixedIdGenerator; use Ssch\Typo3Encore\Integration\IdGenerator; use Ssch\Typo3Encore\Integration\IdGeneratorInterface; +use Ssch\Typo3Encore\Integration\TypoScriptFrontendControllerEventListener; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use TYPO3\CMS\Core\Core\Environment; +use TYPO3\CMS\Frontend\Event\AfterCacheableContentIsGeneratedEvent; return static function (ContainerConfigurator $containerConfigurator, ContainerBuilder $containerBuilder): void { $services = $containerConfigurator->services(); @@ -29,8 +31,10 @@ ]); $services->alias(IdGeneratorInterface::class, IdGenerator::class); - $services->set(FixedIdGenerator::class)->args(['fixed']); + $services->set(TypoScriptFrontendControllerEventListener::class)->tag('event.listener', [ + 'event' => AfterCacheableContentIsGeneratedEvent::class, + ]); if (Environment::getContext()->isTesting()) { $services->alias(IdGeneratorInterface::class, FixedIdGenerator::class); diff --git a/Tests/Functional/IncludeFilesTest.php b/Tests/Functional/IncludeFilesTest.php index 7c23117..defa81f 100644 --- a/Tests/Functional/IncludeFilesTest.php +++ b/Tests/Functional/IncludeFilesTest.php @@ -21,17 +21,19 @@ final class IncludeFilesTest extends FunctionalTestCase */ private const ROOT_PAGE_UID = 1; + protected array $testExtensionsToLoad = ['typo3conf/ext/typo3_encore']; + + protected array $pathsToLinkInTestInstance = [ + 'typo3conf/ext/typo3_encore/Tests/Functional/Fixtures/sites' => 'typo3conf/sites', + ]; + protected function setUp(): void { - $this->testExtensionsToLoad[] = 'typo3conf/ext/typo3_encore'; - $this->pathsToLinkInTestInstance['typo3conf/ext/typo3_encore/Tests/Functional/Fixtures/sites'] = 'typo3conf/sites'; parent::setUp(); $this->importCSVDataSet(__DIR__ . '/Fixtures/pages.csv'); } - /** - * @runInSeparateProcess - */ + #[\PHPUnit\Framework\Attributes\RunInSeparateProcess] public function testAddFiles(): void { $this->setUpFrontendRootPage( @@ -51,9 +53,7 @@ public function testAddFiles(): void ); } - /** - * @runInSeparateProcess - */ + #[\PHPUnit\Framework\Attributes\RunInSeparateProcess] public function testAddFilesWithAbsRefPrefix(): void { $this->setUpFrontendRootPage( @@ -78,9 +78,7 @@ public function testAddFilesWithAbsRefPrefix(): void ); } - /** - * @runInSeparateProcess - */ + #[\PHPUnit\Framework\Attributes\RunInSeparateProcess] public function testAddFilesWithHtml5DocType(): void { $this->setUpFrontendRootPage( diff --git a/Tests/Functional/ViewHelpers/Stimulus/ActionViewHelperTest.php b/Tests/Functional/ViewHelpers/Stimulus/ActionViewHelperTest.php index 256fc42..95fe7e2 100644 --- a/Tests/Functional/ViewHelpers/Stimulus/ActionViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Stimulus/ActionViewHelperTest.php @@ -12,7 +12,6 @@ namespace Ssch\Typo3Encore\Tests\Functional\ViewHelpers\Stimulus; use Generator; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\View\StandaloneView; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -20,20 +19,19 @@ final class ActionViewHelperTest extends FunctionalTestCase { protected StandaloneView $view; + protected array $testExtensionsToLoad = ['typo3conf/ext/typo3_encore']; + + protected bool $initializeDatabase = false; + protected function setUp(): void { - $this->testExtensionsToLoad[] = 'typo3conf/ext/typo3_encore'; - $this->initializeDatabase = false; parent::setUp(); - $this->view = GeneralUtility::makeInstance(StandaloneView::class); + $this->view = $this->get(StandaloneView::class); } - /** - * @param array|string $controllerName - * @dataProvider provideRenderStimulusAction - */ + #[\PHPUnit\Framework\Attributes\DataProvider('provideRenderStimulusAction')] public function testRenderData( - $controllerName, + array|string $controllerName, ?string $actionName, ?string $eventName, string $expected @@ -52,7 +50,7 @@ public function testRenderData( self::assertSame($expected, $this->view->render()); } - public function provideRenderStimulusAction(): Generator + public static function provideRenderStimulusAction(): Generator { yield 'with default event' => [ 'controllerName' => 'my-controller', diff --git a/Tests/Functional/ViewHelpers/Stimulus/ControllerViewHelperTest.php b/Tests/Functional/ViewHelpers/Stimulus/ControllerViewHelperTest.php index 8a4d791..e1b0c21 100644 --- a/Tests/Functional/ViewHelpers/Stimulus/ControllerViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Stimulus/ControllerViewHelperTest.php @@ -12,7 +12,6 @@ namespace Ssch\Typo3Encore\Tests\Functional\ViewHelpers\Stimulus; use Generator; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\View\StandaloneView; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -20,19 +19,18 @@ final class ControllerViewHelperTest extends FunctionalTestCase { protected StandaloneView $view; + protected bool $initializeDatabase = false; + + protected array $testExtensionsToLoad = ['typo3conf/ext/typo3_encore']; + protected function setUp(): void { - $this->testExtensionsToLoad[] = 'typo3conf/ext/typo3_encore'; - $this->initializeDatabase = false; parent::setUp(); - $this->view = GeneralUtility::makeInstance(StandaloneView::class); + $this->view = $this->get(StandaloneView::class); } - /** - * @param mixed $controllerName - * @dataProvider provideRenderStimulusController - */ - public function testRenderData($controllerName, array $controllerValues, string $expected): void + #[\PHPUnit\Framework\Attributes\DataProvider('provideRenderStimulusController')] + public function testRenderData(mixed $controllerName, array $controllerValues, string $expected): void { $this->view->assignMultiple([ 'controllerName' => $controllerName, @@ -47,7 +45,7 @@ public function testRenderData($controllerName, array $controllerValues, string self::assertSame($expected, $this->view->render()); } - public function provideRenderStimulusController(): Generator + public static function provideRenderStimulusController(): Generator { yield 'empty' => [ 'controllerName' => [], diff --git a/Tests/Functional/ViewHelpers/Stimulus/TargetViewHelperTest.php b/Tests/Functional/ViewHelpers/Stimulus/TargetViewHelperTest.php index 8c5f032..220ed71 100644 --- a/Tests/Functional/ViewHelpers/Stimulus/TargetViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Stimulus/TargetViewHelperTest.php @@ -12,7 +12,6 @@ namespace Ssch\Typo3Encore\Tests\Functional\ViewHelpers\Stimulus; use Generator; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\View\StandaloneView; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -20,19 +19,18 @@ final class TargetViewHelperTest extends FunctionalTestCase { protected StandaloneView $view; + protected bool $initializeDatabase = false; + + protected array $testExtensionsToLoad = ['typo3conf/ext/typo3_encore']; + protected function setUp(): void { - $this->testExtensionsToLoad[] = 'typo3conf/ext/typo3_encore'; - $this->initializeDatabase = false; parent::setUp(); - $this->view = GeneralUtility::makeInstance(StandaloneView::class); + $this->view = $this->get(StandaloneView::class); } - /** - * @param mixed $controllerName - * @dataProvider provideRenderStimulusTarget - */ - public function testRenderData($controllerName, ?string $targetName, string $expected): void + #[\PHPUnit\Framework\Attributes\DataProvider('provideRenderStimulusTarget')] + public function testRenderData(mixed $controllerName, ?string $targetName, string $expected): void { $this->view->assignMultiple([ 'controllerName' => $controllerName, @@ -47,7 +45,7 @@ public function testRenderData($controllerName, ?string $targetName, string $exp self::assertSame($expected, $this->view->render()); } - public function provideRenderStimulusTarget(): Generator + public static function provideRenderStimulusTarget(): Generator { yield 'simple' => [ 'controllerName' => 'my-controller', diff --git a/Tests/Functional/ViewHelpers/SvgViewHelperTest.php b/Tests/Functional/ViewHelpers/SvgViewHelperTest.php index e7d3341..9ed6676 100644 --- a/Tests/Functional/ViewHelpers/SvgViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/SvgViewHelperTest.php @@ -11,7 +11,6 @@ namespace Ssch\Typo3Encore\Tests\Functional\ViewHelpers; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\View\StandaloneView; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -24,17 +23,19 @@ final class SvgViewHelperTest extends FunctionalTestCase protected StandaloneView $view; + protected array $testExtensionsToLoad = ['typo3conf/ext/typo3_encore']; + + protected array $pathsToLinkInTestInstance = [ + 'typo3conf/ext/typo3_encore/Tests/Functional/ViewHelpers/Fixtures/fileadmin/user_upload' => 'fileadmin/user_upload', + ]; + protected function setUp(): void { - $this->pathsToLinkInTestInstance['typo3conf/ext/typo3_encore/Tests/Functional/ViewHelpers/Fixtures/fileadmin/user_upload'] = 'fileadmin/user_upload'; - $this->testExtensionsToLoad[] = 'typo3conf/ext/typo3_encore'; parent::setUp(); - $this->view = GeneralUtility::makeInstance(StandaloneView::class); + $this->view = $this->get(StandaloneView::class); } - /** - * @dataProvider renderDataProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('renderDataProvider')] public function testRender(array $arguments, string $expected): void { $arguments['src'] = 'fileadmin/user_upload/sprite.svg'; @@ -54,16 +55,14 @@ public function testRender(array $arguments, string $expected): void self::assertSame($expected, $this->view->render()); } - public function renderDataProvider(): array + public static function renderDataProvider(): array { return [ [ [ 'name' => 'name', ], - sprintf( - '' - ), + '', ], [ [ diff --git a/Tests/Unit/Asset/TagRendererTest.php b/Tests/Unit/Asset/TagRendererTest.php index 7ae822d..c6773be 100644 --- a/Tests/Unit/Asset/TagRendererTest.php +++ b/Tests/Unit/Asset/TagRendererTest.php @@ -95,9 +95,7 @@ public function testRenderWebpackScriptTagsWithDefaultBuildWithoutAssetRegistrat $this->subject->renderWebpackScriptTags($scriptTag); } - /** - * @dataProvider scriptTagsWithPosition - */ + #[\PHPUnit\Framework\Attributes\DataProvider('scriptTagsWithPosition')] public function testRenderWebpackScriptTagsWithDefaultBuildInPosition( string $position, bool $isLibrary, @@ -125,7 +123,7 @@ public function testRenderWebpackScriptTagsWithDefaultBuildInPosition( $this->subject->renderWebpackScriptTags($scriptTag); } - public function scriptTagsWithPosition(): array + public static function scriptTagsWithPosition(): array { return [ // $position, $isLibrary, $expectedPageRendererCall diff --git a/Tests/Unit/Form/FormDataProvider/RichtextEncoreConfigurationTest.php b/Tests/Unit/Form/FormDataProvider/RichtextEncoreConfigurationTest.php index 8bfb993..de79719 100644 --- a/Tests/Unit/Form/FormDataProvider/RichtextEncoreConfigurationTest.php +++ b/Tests/Unit/Form/FormDataProvider/RichtextEncoreConfigurationTest.php @@ -30,13 +30,12 @@ protected function setUp(): void } /** - * @dataProvider provideRteConfigurationWithEncoreFiles - * - * @param string|string[] $contentsCss + * @param string|string[] $contentCss */ - public function testFormConfiguration($contentsCss, array $expected): void + #[\PHPUnit\Framework\Attributes\DataProvider('provideRteConfigurationWithEncoreFiles')] + public function testFormConfiguration(array|string $contentCss, array $expected): void { - $data = $this->createFormData($contentsCss); + $data = $this->createFormData($contentCss); $data = $this->subject->addData($data); $valueAfterProcessing = $data['processedTca']['columns']['testColumn']['config']['richtextConfiguration']['editor']['config']['contentsCss']; @@ -55,7 +54,7 @@ public function provideRteConfigurationWithoutEncoreFiles(): Iterator ]; } - public function provideRteConfigurationWithEncoreFiles(): Iterator + public static function provideRteConfigurationWithEncoreFiles(): Iterator { yield [ 'contentCss' => 'typo3_encore:entryPoint', diff --git a/Tests/Unit/Integration/TypoScriptFrontendControllerHooksTest.php b/Tests/Unit/Integration/TypoScriptFrontendControllerHooksTest.php deleted file mode 100644 index c1e1d48..0000000 --- a/Tests/Unit/Integration/TypoScriptFrontendControllerHooksTest.php +++ /dev/null @@ -1,106 +0,0 @@ -typoScriptFrontendController = $this->getMockBuilder( - TypoScriptFrontendController::class - )->disableOriginalConstructor() - ->getMock(); - $this->settingsService = $this->getMockBuilder(SettingsServiceInterface::class)->getMock(); - $this->assetRegistry = $this->getMockBuilder(AssetRegistryInterface::class)->getMock(); - $GLOBALS['TSFE'] = $this->typoScriptFrontendController; - $this->subject = new TypoScriptFrontendControllerHooks($this->assetRegistry, $this->settingsService); - } - - public function testRegistryDoesNotContainFiles(): void - { - $this->assetRegistry->expects(self::once())->method('getRegisteredFiles')->willReturn([]); - $this->assetRegistry->expects(self::never())->method('getDefaultAttributes'); - $this->settingsService->expects(self::never())->method('getSettings'); - $this->subject->contentPostProcAll([], $this->typoScriptFrontendController); - - self::assertArrayNotHasKey('encore_asset_registry', $this->typoScriptFrontendController->config); - } - - public function testRegistryContainsFiles(): void - { - $registeredFiles = [ - 'preload' => [ - 'files' => [ - 'style' => [ - 'file1.css' => [ - 'crossorigin' => true, - ], - 'script' => [ - 'file2.js' => [ - 'crossorigin' => true, - ], - ], - ], - ], - ], - ]; - $defaultAttributes = [ - 'crossorigin' => true, - ]; - $settings = [ - 'preload' => [ - 'enable' => true, - ], - ]; - - $this->assetRegistry->expects(self::exactly(2))->method('getRegisteredFiles')->willReturn($registeredFiles); - $this->assetRegistry->expects(self::once())->method('getDefaultAttributes')->willReturn($defaultAttributes); - $this->settingsService->expects(self::once())->method('getSettings')->willReturn($settings); - $this->subject->contentPostProcAll([], $this->typoScriptFrontendController); - - self::assertArrayHasKey('encore_asset_registry', $this->typoScriptFrontendController->config); - self::assertSame( - $registeredFiles, - $this->typoScriptFrontendController->config['encore_asset_registry']['registered_files'] - ); - self::assertSame( - $defaultAttributes, - $this->typoScriptFrontendController->config['encore_asset_registry']['default_attributes'] - ); - self::assertSame($settings, $this->typoScriptFrontendController->config['encore_asset_registry']['settings']); - } -} diff --git a/composer.json b/composer.json index bea91e9..a9f614f 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,6 @@ "type": "typo3-cms-extension", "description": "Use Webpack Encore in TYPO3 Context", "license": "GPL-2.0-or-later", - "homepage": "http://www.schreibersebastian.de", "keywords": [ "encore", "webpack" @@ -12,37 +11,36 @@ { "name": "Sebastian Schreiber", "email": "breakpoint@schreibersebastian.de", - "role": "Developer", - "homepage": "http://www.schreibersebastian.de" + "role": "Developer" } ], "prefer-stable": true, "minimum-stability": "dev", "require": { - "php": ">=7.4", - "typo3/cms-core": "^10.4.2 || ^11.5 || ^12.4", - "symfony/web-link": "^5.4 || ^6", - "symfony/asset": "^5.0 || ^6", + "php": ">=8.1", + "typo3/cms-core": "^12.4 || ^13.4", + "symfony/web-link": "^6.0 || ^7.0", + "symfony/asset": "^6.0 || ^7.0", "ext-dom": "*", - "typo3/cms-tstemplate": "^10.4.2 || ^11.5 || ^12.4", + "typo3/cms-tstemplate": "^12.4 || ^13.4", "webmozart/assert": "^1.10" }, "require-dev": { "phpstan/phpstan": "^1.0", - "typo3/testing-framework": "^7.0.2 || dev-main", - "typo3/minimal": "^10.4 || ^11.5 || ^12.4", + "typo3/testing-framework": "^8.0 || ^9.0", + "typo3/minimal": "^12.4 || ^13.4", "php-parallel-lint/php-parallel-lint": "^1.3", "phpspec/prophecy-phpunit": "^2.0", "rector/rector": "^1.2.8", "phpstan/phpstan-webmozart-assert": "^1.2.2", - "sbuerk/typo3-cmscomposerinstallers-testingframework-bridge": "^0.1.1", "phpstan/phpstan-phpunit": "^1.0", "jangregor/phpstan-prophecy": "^1.0", "phpstan/extension-installer": "^1.1", "saschaegerer/phpstan-typo3": "^1.8.0", "symplify/easy-coding-standard": "^12.1", "phpstan/phpstan-strict-rules": "^1.4.4", - "typo3/cms-rte-ckeditor": "^10.4 || ^11.5 || ^12.4" + "typo3/cms-rte-ckeditor": "^12.4 || ^13.4", + "typo3/cms-install": "^12.4 || ^13.4" }, "replace": { "typo3-ter/typo3-encore": "self.version" @@ -54,8 +52,7 @@ }, "autoload-dev": { "psr-4": { - "Ssch\\Typo3Encore\\Tests\\": "Tests", - "TYPO3\\JsonResponse\\": ".Build/vendor/typo3/testing-framework/Resources/Core/Functional/Extensions/json_response/Classes" + "Ssch\\Typo3Encore\\Tests\\": "Tests" } }, "config": { @@ -69,15 +66,10 @@ "allow-plugins": { "phpstan/extension-installer": true, "typo3/class-alias-loader": true, - "typo3/cms-composer-installers": true, - "sbuerk/typo3-cmscomposerinstallers-testingframework-bridge": true + "typo3/cms-composer-installers": true } }, "scripts": { - "post-autoload-dump": [ - "mkdir -p .Build/public/typo3conf/ext/", - "[ -L .Build/public/typo3conf/ext/typo3_encore ] || ln -snvf ../../../../. .Build/public/typo3conf/ext/typo3_encore" - ], "analyze": "phpstan --memory-limit=-1", "test-php-lint": [ ".Build/bin/parallel-lint ./Classes/", @@ -98,12 +90,11 @@ }, "extra": { "branch-alias": { - "dev-master": "4.x-dev" + "dev-master": "6.x-dev" }, "typo3/cms": { "extension-key": "typo3_encore", - "web-dir": ".Build", - "app-dir": ".Build" + "web-dir": ".Build/Web" } } } diff --git a/ext_emconf.php b/ext_emconf.php index a23ef02..493e70c 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -7,10 +7,10 @@ 'author' => 'Sebastian Schreiber', 'author_email' => 'breakpoint@schreibersebastian.de', 'state' => 'stable', - 'version' => '5.0.6', + 'version' => '6.0.0', 'constraints' => [ 'depends' => [ - 'typo3' => '10.4.2-12.4.99', + 'typo3' => '12.4.0-13.4.99', ], 'conflicts' => [], 'suggests' => [], diff --git a/ext_localconf.php b/ext_localconf.php index b303026..816e4c4 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -6,7 +6,6 @@ // Enable for Frontend and Backend at the same time $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'][$packageKey] = \Ssch\Typo3Encore\Integration\PageRendererHooks::class . '->renderPreProcess'; // Add collected assets to page cache - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all'][$packageKey] = \Ssch\Typo3Encore\Integration\TypoScriptFrontendControllerHooks::class . '->contentPostProcAll'; }, 'typo3_encore'); $GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord'][\Ssch\Typo3Encore\Form\FormDataProvider\RichtextEncoreConfiguration::class] = [ diff --git a/rector.php b/rector.php index dd68f60..116fa46 100644 --- a/rector.php +++ b/rector.php @@ -16,5 +16,5 @@ $rectorConfig->paths([__DIR__ . '/Classes', __DIR__ . '/Configuration', __DIR__ . '/Tests']); // define sets of rules - $rectorConfig->sets([LevelSetList::UP_TO_PHP_74]); + $rectorConfig->sets([LevelSetList::UP_TO_PHP_81, \Rector\PHPUnit\Set\PHPUnitSetList::PHPUNIT_100]); };