Skip to content

Commit

Permalink
Merge pull request #392 from andersundsehr/phpstan
Browse files Browse the repository at this point in the history
✨ add phpstan and test all possible php and TYPO3 versions
  • Loading branch information
lochmueller authored Jul 17, 2023
2 parents 19c7013 + fee2a3f commit df3ff42
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 9 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions Classes/Service/InlineAssets/AbstractInlineAssets.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
*/
abstract class AbstractInlineAssets extends AbstractService
{
protected string $sitePath;
protected ConfigurationService $configurationService;

public function __construct()
{
$this->sitePath = Environment::getPublicPath(); // [^/]$
Expand Down
22 changes: 15 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
Expand All @@ -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": {
Expand All @@ -85,6 +90,9 @@
],
"test": [
"phpunit -c Tests/UnitTests.xml"
],
"phpstan": [
".Build/bin/phpstan"
]
}
}
1 change: 1 addition & 0 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!!',
Expand Down
6 changes: 6 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
ignoreErrors:
-
message: "#^Function brotli_compress not found\\.$#"
count: 1
path: Classes/Generator/BrotliGenerator.php
7 changes: 7 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
includes:
- phpstan-baseline.neon
- .Build/vendor/andersundsehr/phpstan-git-files/extension.php

parameters:
level: 1
reportUnmatchedIgnoredErrors: false

0 comments on commit df3ff42

Please sign in to comment.