From 559d44a72574e35e3044bb8698c3bfb0591cdd2a Mon Sep 17 00:00:00 2001 From: Henning Leutz <leutz@pcsg.de> Date: Tue, 30 Apr 2024 14:42:04 +0200 Subject: [PATCH] chore: phive integration --- .gitignore | 5 ++++- .phive/phars.xml | 4 ++++ phpcs.xml.dist | 24 ++++++++++++++++++++++++ phpstan-baseline.neon | 0 phpstan.dist.neon | 11 +++++++++++ tests/phpstan-bootstrap.php | 13 +++++++++++++ 6 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 .phive/phars.xml create mode 100644 phpcs.xml.dist 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 index fa8f1f5..5d49cc7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ -checklist.md5 \ No newline at end of file +tools/ +phpstan.neon +.phpunit.result.cache +phpunit.xml 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/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 0000000..300bdee --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,24 @@ +<?xml version="1.0"?> +<ruleset> + <!-- Use PSR-12 ruleset --> + <rule ref="PSR12"/> + + <!-- Only scan *.php files --> + <arg name="extensions" value="php"/> + + <!-- Ignore warnings --> + <arg name="warning-severity" value="0"/> + + <!-- Process 64 (or number of CPU cores) files in parallel --> + <arg name="parallel" value="64"/> + + <!-- Output relative file paths, by setting the current folder as the basepath --> + <arg name="basepath" value="."/> + + <!-- Show colored output --> + <arg name="colors"/> + + <!-- Scan everything in the current folder --> + <file>.</file> +</ruleset> + 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..37e6b52 --- /dev/null +++ b/phpstan.dist.neon @@ -0,0 +1,11 @@ +includes: + - phpstan-baseline.neon + +parameters: + level: 1 + paths: + - src + - ajax + bootstrapFiles: + - tests/phpstan-bootstrap.php + 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