diff --git a/composer.json b/composer.json index fbf9b05..039e79e 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "ext-intl": "*", "friendsofphp/php-cs-fixer": "^3.49", "phpunit/phpunit": "^9.6", - "vimeo/psalm": "^4.30" + "vimeo/psalm": "^5.21" }, "suggest": { diff --git a/psalm.xml.dist b/psalm.xml.dist index 1536a92..82054b2 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -4,6 +4,8 @@ ensureArrayStringOffsetsExist="true" findUnusedVariablesAndParams="true" findUnusedPsalmSuppress="true" + findUnusedBaselineEntry="true" + findUnusedCode="false" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" diff --git a/src/Duration.php b/src/Duration.php index 01affdf..8eb118d 100644 --- a/src/Duration.php +++ b/src/Duration.php @@ -62,6 +62,7 @@ public static function fromString(string $duration): self /** * @psalm-pure * @psalm-suppress ImpurePropertyAssignment + * @psalm-suppress InaccessibleProperty */ public static function fromParts(int $years = 0, int $months = 0, int $weeks = 0, int $days = 0, int $hours = 0, int $minutes = 0, int $seconds = 0, int $microseconds = 0, bool $inverted = false): self { @@ -205,7 +206,6 @@ public function isZero(): bool public function format(string $format): string { - /** @psalm-suppress ImpureMethodCall */ return $this->interval->format($format); } @@ -303,6 +303,7 @@ public function __debugInfo(): array private static function fromSinglePart(string $part, int $count): self { if (1 !== $count) { + /** @psalm-suppress ImpureMethodCall */ return new self(\DateInterval::createFromDateString($count.$part)); } @@ -313,6 +314,7 @@ private static function fromSinglePart(string $part, int $count): self static $durations = []; if (!isset($durations[$part])) { + /** @psalm-suppress ImpureMethodCall */ $durations[$part] = new self(\DateInterval::createFromDateString('1'.$part)); } diff --git a/src/TimeZone.php b/src/TimeZone.php index 11fa910..2c5cc3e 100644 --- a/src/TimeZone.php +++ b/src/TimeZone.php @@ -139,7 +139,7 @@ public function __serialize(): array } /** - * @param array{name: string} $data + * @param array{name: non-empty-string} $data */ public function __unserialize(array $data): void {