diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index db7ce3fd827..39cc4d71785 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,14 +3,24 @@ on: [push,pull_request] jobs: build: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: [ '8.0', '8.1', '8.2' ] + typo3: [ '11', '12' ] + exclude: + - php: '8.0' + typo3: '12' steps: - uses: actions/checkout@v1 - name: Setup PHP with PECL extension uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: ${{ matrix.php }} extensions: imagick - name: Composer install - run: composer install --optimize-autoloader --prefer-dist + run: composer require typo3/minimal="^${{ matrix.typo3 }}" --dev --optimize-autoloader --prefer-dist + - name: Composer phpstan + run: composer phpstan - name: Composer test run: composer test diff --git a/Classes/Service/InlineAssets/AbstractInlineAssets.php b/Classes/Service/InlineAssets/AbstractInlineAssets.php index e503203b4d0..74b547ee718 100644 --- a/Classes/Service/InlineAssets/AbstractInlineAssets.php +++ b/Classes/Service/InlineAssets/AbstractInlineAssets.php @@ -16,6 +16,9 @@ */ abstract class AbstractInlineAssets extends AbstractService { + protected string $sitePath; + protected ConfigurationService $configurationService; + public function __construct() { $this->sitePath = Environment::getPublicPath(); // [^/]$ diff --git a/composer.json b/composer.json index 794baa7779f..15b3c4c33eb 100755 --- a/composer.json +++ b/composer.json @@ -30,12 +30,12 @@ } ], "require": { - "php": "^8.0", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0", "ext-pdo": "*", "ext-zlib": "*", - "typo3/cms-core": "^11.5||^12.4", - "typo3/cms-backend": "^11.5||^12.4", - "typo3/cms-extensionmanager": "^11.5||^12.4" + "typo3/cms-core": "^11.5 || ^12.4", + "typo3/cms-backend": "^11.5 || ^12.4", + "typo3/cms-extensionmanager": "^11.5 || ^12.4" }, "replace": { "typo3-ter/staticfilecache": "self.version" @@ -49,9 +49,13 @@ }, "require-dev": { "typo3/testing-framework": "^7.0", - "friendsofphp/php-cs-fixer": "^3.16", + "friendsofphp/php-cs-fixer": "^3.9", "phpmetrics/phpmetrics": "^2.5", - "ssch/typo3-rector": "^1.2" + "ssch/typo3-rector": "^1.2", + "phpstan/phpstan": "^1.10", + "saschaegerer/phpstan-typo3": "^1.8", + "andersundsehr/phpstan-git-files": "^1.0", + "phpstan/extension-installer": "^1.3" }, "suggest": { "lochmueller/seocli": "Scan websites against SEO criteria and/or trigger the indexing process and cache warming in deployment scripts", @@ -65,7 +69,8 @@ "bin-dir": ".Build/bin", "allow-plugins": { "typo3/class-alias-loader": true, - "typo3/cms-composer-installers": true + "typo3/cms-composer-installers": true, + "phpstan/extension-installer": true } }, "extra": { @@ -85,6 +90,9 @@ ], "test": [ "phpunit -c Tests/UnitTests.xml" + ], + "phpstan": [ + ".Build/bin/phpstan" ] } } diff --git a/ext_emconf.php b/ext_emconf.php index ca403842a04..5cd722f3bb5 100755 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -2,6 +2,7 @@ declare(strict_types=1); +/** @var string $_EXTKEY */ $EM_CONF[$_EXTKEY] = [ 'title' => 'StaticFileCache', 'description' => 'Transparent static file cache solution using mod_rewrite and mod_expires. Increase performance for static pages by a factor of 230!!', diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 00000000000..0c683e65181 --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,6 @@ +parameters: + ignoreErrors: + - + message: "#^Function brotli_compress not found\\.$#" + count: 1 + path: Classes/Generator/BrotliGenerator.php diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 00000000000..fb0847063a4 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,7 @@ +includes: + - phpstan-baseline.neon + - .Build/vendor/andersundsehr/phpstan-git-files/extension.php + +parameters: + level: 1 + reportUnmatchedIgnoredErrors: false