From c92a004f1c5b2ca7bdc76ee0afa279e21cf1040f Mon Sep 17 00:00:00 2001
From: Jan Wennrich <jan.wennrich@pcsg.de>
Date: Fri, 24 May 2024 17:01:51 +0200
Subject: [PATCH] chore: setup PHPStan for project tooling

---
 .gitignore                  |  2 ++
 .phive/phars.xml            |  4 ++++
 phpstan-baseline.neon       |  0
 phpstan.dist.neon           |  9 +++++++++
 tests/phpstan-bootstrap.php | 13 +++++++++++++
 5 files changed, 28 insertions(+)
 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
index a8c0d1b..0920b95 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
 
 tools/
+
+phpstan.neon
diff --git a/.phive/phars.xml b/.phive/phars.xml
new file mode 100644
index 0000000..f909b52
--- /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.11.1" installed="1.11.1" 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..e929f5a
--- /dev/null
+++ b/phpstan.dist.neon
@@ -0,0 +1,9 @@
+includes:
+	- phpstan-baseline.neon
+
+parameters:
+    level: 8
+    paths:
+        - src
+        - ajax
+    tipsOfTheDay: false
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