Skip to content

Commit

Permalink
use psalm v5
Browse files Browse the repository at this point in the history
  • Loading branch information
gharlan committed Feb 9, 2024
1 parent d255d87 commit 19fc844
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 2 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion src/Duration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -205,7 +206,6 @@ public function isZero(): bool

public function format(string $format): string
{
/** @psalm-suppress ImpureMethodCall */
return $this->interval->format($format);
}

Expand Down Expand Up @@ -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));
}

Expand All @@ -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));
}

Expand Down
2 changes: 1 addition & 1 deletion src/TimeZone.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 19fc844

Please sign in to comment.