From 3c42d85e6a5a6fed2a7c65715eb3a860cd7792be Mon Sep 17 00:00:00 2001 From: Henning Leutz <leutz@pcsg.de> Date: Wed, 1 May 2024 10:26:52 +0200 Subject: [PATCH] chore: phpstan integration --- .gitignore | 4 ++++ .phive/phars.xml | 4 ++++ phpstan-baseline.neon | 0 phpstan.dist.neon | 9 +++++++++ tests/phpstan-bootstrap.php | 13 +++++++++++++ 5 files changed, 30 insertions(+) create mode 100644 .gitignore create mode 100644 .phive/phars.xml create mode 100644 phpstan-baseline.neon create mode 100644 phpstan.dist.neon create mode 100644 tests/phpstan-bootstrap.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f4da208 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +tools/ +phpstan.neon +.phpunit.result.cache +phpunit.xml \ No newline at end of file diff --git a/.phive/phars.xml b/.phive/phars.xml new file mode 100644 index 0000000..a1315a0 --- /dev/null +++ b/.phive/phars.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<phive xmlns="https://phar.io/phive"> + <phar name="phpstan" version="^1.10.67" installed="1.10.67" location="./tools/phpstan" copy="false"/> +</phive> diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 0000000..e69de29 diff --git a/phpstan.dist.neon b/phpstan.dist.neon new file mode 100644 index 0000000..c17863f --- /dev/null +++ b/phpstan.dist.neon @@ -0,0 +1,9 @@ +includes: + - phpstan-baseline.neon + +parameters: + level: 1 + paths: + - src + bootstrapFiles: + - tests/phpstan-bootstrap.php \ No newline at end of file diff --git a/tests/phpstan-bootstrap.php b/tests/phpstan-bootstrap.php new file mode 100644 index 0000000..b61ff4b --- /dev/null +++ b/tests/phpstan-bootstrap.php @@ -0,0 +1,13 @@ +<?php + +if (!defined('QUIQQER_SYSTEM')) { + define('QUIQQER_SYSTEM', true); +} + +if (!defined('QUIQQER_AJAX')) { + define('QUIQQER_AJAX', true); +} + +putenv("QUIQQER_OTHER_AUTOLOADERS=KEEP"); + +require_once __DIR__ . '/../../../../bootstrap.php'; -- GitLab