Browse Source

ignore FrozenDate in phpstan and regen baselines

Kevin Pfeifer 2 years ago
parent
commit
41c13cf502
3 changed files with 55 additions and 1 deletions
  1. 40 0
      phpstan-baseline.neon
  2. 2 0
      phpstan.neon.dist
  3. 13 1
      psalm-baseline.xml

+ 40 - 0
phpstan-baseline.neon

@@ -91,6 +91,11 @@ parameters:
 			path: src/Database/Driver.php
 
 		-
+			message: "#^Class Cake\\\\Chronos\\\\Date not found\\.$#"
+			count: 1
+			path: src/Database/Expression/CaseStatementExpression.php
+
+		-
 			message: "#^Unsafe usage of new static\\(\\)\\.$#"
 			count: 8
 			path: src/Database/Expression/QueryExpression.php
@@ -101,6 +106,11 @@ parameters:
 			path: src/Database/Expression/TupleComparison.php
 
 		-
+			message: "#^Class Cake\\\\Chronos\\\\Date not found\\.$#"
+			count: 1
+			path: src/Database/Expression/WhenThenExpression.php
+
+		-
 			message: "#^Access to an undefined property Exception\\:\\:\\$queryString\\.$#"
 			count: 1
 			path: src/Database/Log/LoggingStatement.php
@@ -111,6 +121,11 @@ parameters:
 			path: src/Database/Statement/PDOStatement.php
 
 		-
+			message: "#^Parameter \\#1 \\$class of method Cake\\\\Database\\\\Type\\\\DateTimeType\\:\\:_setClassName\\(\\) expects class\\-string\\<DateTime\\>\\|class\\-string\\<DateTimeImmutable\\>, string given\\.$#"
+			count: 2
+			path: src/Database/Type/DateType.php
+
+		-
 			message: "#^Property PDOStatement\\:\\:\\$queryString \\(string\\) in isset\\(\\) is not nullable\\.$#"
 			count: 1
 			path: src/Database/Statement/PDOStatement.php
@@ -201,11 +216,36 @@ parameters:
 			path: src/I18n/Date.php
 
 		-
+			message: "#^Access to an undefined static property static\\(Cake\\\\I18n\\\\FrozenDate\\)\\:\\:\\$diffFormatter\\.$#"
+			count: 2
+			path: src/I18n/FrozenDate.php
+
+		-
+			message: "#^Cake\\\\I18n\\\\FrozenDate\\:\\:__construct\\(\\) calls parent\\:\\:__construct\\(\\) but Cake\\\\I18n\\\\FrozenDate does not extend any class\\.$#"
+			count: 1
+			path: src/I18n/FrozenDate.php
+
+		-
 			message: "#^Call to an undefined method Cake\\\\Chronos\\\\DifferenceFormatterInterface\\:\\:dateAgoInWords\\(\\)\\.$#"
 			count: 1
 			path: src/I18n/FrozenDate.php
 
 		-
+			message: "#^Call to an undefined static method static\\(Cake\\\\I18n\\\\FrozenDate\\)\\:\\:getTestNow\\(\\)\\.$#"
+			count: 1
+			path: src/I18n/FrozenDate.php
+
+		-
+			message: "#^Call to an undefined static method static\\(Cake\\\\I18n\\\\FrozenDate\\)\\:\\:hasTestNow\\(\\)\\.$#"
+			count: 1
+			path: src/I18n/FrozenDate.php
+
+		-
+			message: "#^Parameter \\#1 \\$date of method Cake\\\\I18n\\\\FrozenDate\\:\\:_formatObject\\(\\) expects DateTime\\|DateTimeImmutable, static\\(Cake\\\\I18n\\\\FrozenDate\\) given\\.$#"
+			count: 1
+			path: src/I18n/FrozenDate.php
+
+		-
 			message: "#^Unsafe usage of new static\\(\\)\\.$#"
 			count: 1
 			path: src/I18n/FrozenDate.php

+ 2 - 0
phpstan.neon.dist

@@ -15,6 +15,8 @@ parameters:
 			- abort
 		Cake\Command\BaseCommand:
 			- abort
+	excludePaths:
+		- src/I18n/FrozenDate
 
 services:
 	-

+ 13 - 1
psalm-baseline.xml

@@ -277,9 +277,15 @@
       <code>$request-&gt;scheme()</code>
     </PossiblyNullArgument>
   </file>
+  <file src="src/I18n/Date.php">
+    <DeprecatedClass occurrences="2">
+      <code>MutableDate</code>
+      <code>parent::__construct($time, $tz)</code>
+    </DeprecatedClass>
+  </file>
   <file src="src/I18n/DateFormatTrait.php">
     <DeprecatedClass occurrences="5">
-      <code>$time-&gt;timezone($timezone)</code>
+      <code>$time-&gt;setTimezone($timezone)</code>
       <code>Time::UNIX_TIMESTAMP_FORMAT</code>
       <code>static|null</code>
       <code>static|null</code>
@@ -289,6 +295,12 @@
       <code>$format</code>
     </MissingParamType>
   </file>
+  <file src="src/I18n/Time.php">
+    <DeprecatedClass occurrences="2">
+      <code>MutableDateTime</code>
+      <code>parent::__construct($time, $tz)</code>
+    </DeprecatedClass>
+  </file>
   <file src="src/I18n/functions.php">
     <InternalMethod occurrences="8">
       <code>translate</code>