diff --git a/.gitignore b/.gitignore index fa8f1f53f9a838341f3d92b79481d909fcf235a8..5d49cc71d98b16e2ed3cc08be94e85f83584b1e5 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 0000000000000000000000000000000000000000..a1315a09b4adad780a9c5e52f74835c708c5c7d5 --- /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 0000000000000000000000000000000000000000..300bdeee5226a2565edb7219b8c1b84cd39c5030 --- /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 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/phpstan.dist.neon b/phpstan.dist.neon new file mode 100644 index 0000000000000000000000000000000000000000..37e6b52ac8d173c7f1e1645fbf40eab4adeccdb2 --- /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 0000000000000000000000000000000000000000..b61ff4b8300a965e0f46025ba64745a22b118e74 --- /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';