Skip to content

Commit

Permalink
Fix phpstan findings
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Feb 8, 2025
1 parent 271c948 commit 4b47bef
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct()
$this->add(new ChangesCommand());
}

public function add(Command $command): ?Command
public function add(Command $command): Command
{
$command = parent::add($command);

Expand Down
2 changes: 1 addition & 1 deletion src/Changelog/Formatter/PrefixGroupFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private function parseLines(array $lines, array $groupedLines): array
preg_match('/^([0-9A-f]+) (?:\[(.*)\] )?(.*)/', $line, $matches, PREG_UNMATCHED_AS_NULL);

$type = strtoupper($matches[2] ?? $this->defaultGroup);
$line = \sprintf('- [%s] %s', $matches[1], $matches[3]);
$line = \sprintf('- [%s] %s', $matches[1] ?? '', $matches[3] ?? '');

$groupedLines[$type][] = $line;
}
Expand Down
2 changes: 1 addition & 1 deletion src/VersionControl/Git.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function getModifiedFilesSince(string $tag): array
{
$files = [];

$lines = array_filter($this->executeGitCommand(\sprintf('diff --name-status %s..HEAD', $tag)));
$lines = array_filter($this->executeGitCommand(\sprintf('diff --name-status %s..HEAD', $tag)), static function (string $line) { return '' !== $line; });

foreach ($lines as $line) {
[$state, $file] = explode("\t", (string) $line);
Expand Down

0 comments on commit 4b47bef

Please sign in to comment.