From 89ec97524811480137773986c061c0cf5502815b Mon Sep 17 00:00:00 2001
From: Henning Leutz <leutz@pcsg.de>
Date: Wed, 1 May 2024 09:36:26 +0200
Subject: [PATCH] chore: phpstan integration

---
 .gitignore                  |  4 ++++
 .phive/phars.xml            |  4 ++++
 phpstan-baseline.neon       |  0
 phpstan.dist.neon           | 10 ++++++++++
 tests/phpstan-bootstrap.php | 13 +++++++++++++
 5 files changed, 31 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..a545a04
--- /dev/null
+++ b/phpstan.dist.neon
@@ -0,0 +1,10 @@
+includes:
+    - phpstan-baseline.neon
+
+parameters:
+    level: 1
+    paths:
+        - src
+        - ajax
+    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