Skip to content

Commit

Permalink
Removed all redundant psalm error suppressions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Jul 25, 2022
1 parent f3ecc85 commit 4a12b6a
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 14 deletions.
1 change: 0 additions & 1 deletion bin/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ static function (int $errorCode, string $message = '', string $file = '', int $l
$logger
);

/** @psalm-suppress DeprecatedClass */
$application = new Application(Versions::rootPackageName(), Versions::getVersion('laminas/automatic-releases'));

$application->addCommands([
Expand Down
1 change: 1 addition & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
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"
findUnusedPsalmSuppress="true"
>
<projectFiles>
<directory name="bin"/>
Expand Down
10 changes: 4 additions & 6 deletions src/Changelog/ChangelogReleaseNotes.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ public function __construct(
$changelogEntry = clone $changelogEntry;
}

$this->contents = $contents;

/** @psalm-suppress ImpurePropertyAssignment */
$this->contents = $contents;
$this->changelogEntry = $changelogEntry;
}

Expand All @@ -69,6 +67,7 @@ public function contents(): string
return $this->contents;
}

/** @throws RuntimeException if release notes already exist in both merged objects. */
public function merge(self $next): self
{
if ($this->changelogEntry && $next->changelogEntry) {
Expand All @@ -83,9 +82,8 @@ public function merge(self $next): self
$changelogEntry = clone $changelogEntry;
}

$merged = clone $this;
$merged->contents .= self::CONCATENATION_STRING . $next->contents;
/** @psalm-suppress ImpurePropertyAssignment */
$merged = clone $this;
$merged->contents .= self::CONCATENATION_STRING . $next->contents;
$merged->changelogEntry = $changelogEntry;

return $merged;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ final class IssueOrPullRequest
/**
* @psalm-param non-empty-string $title
* @psalm-param list<Label> $labels
*
* @psalm-suppress ImpurePropertyAssignment {@see UriInterface} is pure
*/
private function __construct(
int $number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ final class Label
/**
* @psalm-param non-empty-string $colour
* @psalm-param non-empty-string $name
*
* @psalm-suppress ImpurePropertyAssignment {@see UriInterface} is pure
*/
private function __construct(
string $colour,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ final class Milestone
* @param array<int, IssueOrPullRequest> $entries
* @psalm-param non-empty-string $title
* @psalm-param list<IssueOrPullRequest> $entries
*
* @psalm-suppress ImpurePropertyAssignment {@see UriInterface} is pure
*/
private function __construct(
int $number,
Expand Down
1 change: 0 additions & 1 deletion test/unit/Changelog/ChangelogReleaseNotesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ public function testMergeRaisesExceptionIfBothCurrentAndNextInstanceContainChang

$this->expectException(RuntimeException::class);

/** @psalm-suppress UnusedMethodCall */
$original->merge($toMerge);
}

Expand Down

0 comments on commit 4a12b6a

Please sign in to comment.