Skip to content

Commit

Permalink
[CHORE] Add phpstan and set level to 6
Browse files Browse the repository at this point in the history
  • Loading branch information
garbast committed Nov 17, 2024
1 parent 5e132ed commit 455d090
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 4 deletions.
13 changes: 13 additions & 0 deletions Build/Scripts/phpstan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

THIS_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd "$THIS_SCRIPT_DIR" || exit 1
cd ../../ || exit 1
CORE_ROOT="${PWD}"

Build/Scripts/runTests.sh -s composerInstall

Build/Scripts/runTests.sh -s phpstan

Build/Scripts/runTests.sh -s clean
Build/Scripts/additionalTests.sh -s clean
2 changes: 2 additions & 0 deletions Build/phpstan/phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
parameters:
ignoreErrors:
4 changes: 4 additions & 0 deletions Build/phpstan/phpstan-constants.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php

// testing-framework defines this, used in various tests.
define('ORIGINAL_ROOT', dirname(__FILE__, 2) . '/');
2 changes: 2 additions & 0 deletions Build/phpstan/phpstan.local.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
includes:
- phpstan.neon
21 changes: 21 additions & 0 deletions Build/phpstan/phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
includes:
- phpstan-baseline.neon
- ../vendor/friendsoftypo3/phpstan-typo3/extension.neon

parameters:
# Use local .cache dir instead of /tmp
tmpDir: ../.cache/phpstan

level: 6

bootstrapFiles:
- phpstan-constants.php

paths:
- ../../

excludePaths:
# we do not check required extensions
- ../../Build/*
# ext_emconf.php get the $_EXTKEY set from outside. We'll ignore all of them
- ../ext_emconf.php
18 changes: 14 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
"type": "typo3-cms-extension",
"description": "Collapsible container",
"homepage": "https://www.evoweb.de",
"license": [
"GPL-2.0-or-later"
],
"support" : {
"source" : "https://github.com/evoWeb/sf_books",
"issues" : "https://github.com/evoWeb/sf_books/issues",
"docs": "https://docs.typo3.org/p/evoweb/sf-books/main/en-us/"
},
"config": {
"vendor-dir": "Build/vendor",
"bin-dir": "bin",
Expand All @@ -11,16 +19,18 @@
"typo3/cms-composer-installers": true
}
},
"license": [
"GPL-2.0-or-later"
],
"require": {
"typo3/cms-backend": "^13.0 || 13.0.x-dev || dev-main",
"typo3/cms-core": "^13.0 || 13.0.x-dev || dev-main",
"b13/container": "^3.0.1 || dev-master"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.62.0"
"friendsofphp/php-cs-fixer": "^3.64.0",
"friendsoftypo3/phpstan-typo3": "^0.9.0",
"phpstan/phpdoc-parser": "^1.30.0",
"phpstan/phpstan": "^1.12.5",
"phpunit/phpunit": "^11.0.3",
"typo3/testing-framework": "dev-main"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down

0 comments on commit 455d090

Please sign in to comment.