diff --git a/Jenkinsfile b/Jenkinsfile index a5ff0ed..f5d83fb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,20 +9,6 @@ pipeline { sh 'php composer.phar install --ignore-platform-reqs' } } - stage("Test PHP 7.4") { - steps { - script { - docker.image("memcached:latest").withRun("-p 11212:11211") { c -> - docker.image("redis:latest").withRun("-p 6380:6379") { d -> - docker.image("php:7.4").withRun("-e REDIS_HOST=redis -e REDIS_PORT=11212 -e MEMCACHED_HOST=mem -e MEMCACHED_PORT=6380 --link ${d.id}:redis --link ${c.id}:mem") { p -> - sh "sh build/docker_install.sh" - sh "php ./vendor/bin/phpunit -c build --no-coverage --colors=never" - } - } - } - } - } - } stage("Test PHP 8") { steps { script { @@ -37,6 +23,16 @@ pipeline { } } } + stage('Code Cleanliness') { + agent any + steps { + sh "php ./vendor/bin/phpstan analyse -c phpstan.neon -n --no-progress --no-ansi --error-format=checkstyle | awk '{\$1=\$1;print}' > build/logs/phpstan.log" + recordIssues( + failOnError: false, + tools: [phpStan(reportEncoding: 'UTF-8', pattern: 'build/logs/phpstan.log')] + ) + } + } } post { success { diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..36ff6c8 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,13 @@ +parameters: + checkGenericClassInNonGenericObjectType: false + checkMissingIterableValueType: false + inferPrivatePropertyTypeFromConstructor: true + level: 8 + paths: + - src + excludes_analyse: + - tests + - vendor + # These are objects that basically can return anything + universalObjectCratesClasses: + - Aviat\Ion\Friend