From 04bf0dc4a9f83def97d9154165dcc00cd08d3b42 Mon Sep 17 00:00:00 2001
From: Henning <leutz@pcsg.de>
Date: Tue, 18 Feb 2025 08:13:06 +0100
Subject: [PATCH] fix: correct phpstan errors and update schema urls

This commit includes several modifications:
- Removed the ignoreErrors directives in phpstan-baseline.neon as the corresponding issues have
been resolved
- Updated 'itemtype' URL from 'http://' to 'https://'
- Removed an obsolete comment block above the getSite method in Timeline.php
- Added variable documentation in types/timeline.php to clarify variable types and avoid phpstan
errors.

Related: quiqqer/timeline#3
---
 phpstan-baseline.neon                  | 16 +---------------
 src/QUI/Timeline/Controls/Timeline.php |  7 +------
 types/timeline.php                     |  5 +++++
 3 files changed, 7 insertions(+), 21 deletions(-)

diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index 91a9452..1339890 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -1,16 +1,2 @@
 parameters:
-	ignoreErrors:
-		-
-			message: "#^Parameter \\#2 \\$val of method QUI\\\\QDOM\\:\\:setAttribute\\(\\) expects array\\|bool\\|object\\|string, int given\\.$#"
-			count: 1
-			path: src/QUI/Timeline/Bricks/Timeline.php
-
-		-
-			message: "#^Variable \\$Engine might not be defined\\.$#"
-			count: 1
-			path: types/timeline.php
-
-		-
-			message: "#^Variable \\$Site might not be defined\\.$#"
-			count: 4
-			path: types/timeline.php
+	ignoreErrors:
\ No newline at end of file
diff --git a/src/QUI/Timeline/Controls/Timeline.php b/src/QUI/Timeline/Controls/Timeline.php
index 840fdf7..e93f781 100644
--- a/src/QUI/Timeline/Controls/Timeline.php
+++ b/src/QUI/Timeline/Controls/Timeline.php
@@ -38,7 +38,7 @@ public function __construct(array $attributes = [])
             'displayTemplate' => false,
             // Custom children template css (path to css file); overwrites "display"
             'displayCss' => false,
-            'itemtype' => 'http://schema.org/ItemList',
+            'itemtype' => 'https://schema.org/ItemList',
             'child-itemtype' => 'https://schema.org/ListItem',
             'child-itemprop' => 'itemListElement'
         ]);
@@ -126,11 +126,6 @@ public function getBody(): string
         return $Engine->fetch($templateFile);
     }
 
-
-    /**
-     * @return null|QUI\Projects\Site
-     * @throws Exception
-     */
     protected function getSite(): ?QUI\Interfaces\Projects\Site
     {
         if ($this->getAttribute('Site')) {
diff --git a/types/timeline.php b/types/timeline.php
index f0b74da..b46cfc1 100644
--- a/types/timeline.php
+++ b/types/timeline.php
@@ -2,6 +2,11 @@
 
 /**
  * Site list
+ *
+ * @var QUI\Projects\Project $Project
+ * @var QUI\Projects\Site $Site
+ * @var QUI\Interfaces\Template\EngineInterface $Engine
+ * @var QUI\Template $Template
  */
 
 $Timeline = new QUI\Timeline\Controls\Timeline([
-- 
GitLab