Skip to content

Commit

Permalink
chore(phpstan): reduce baseline (#7275)
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus authored Sep 7, 2023
1 parent 40b7091 commit eb537a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions dev-tools/phpstan/baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,6 @@
'count' => 1,
'path' => __DIR__ . '/../../src/Fixer/Import/OrderedImportsFixer.php',
];
$ignoreErrors[] = [
'message' => '#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#',
'count' => 2,
'path' => __DIR__ . '/../../src/Fixer/Import/OrderedImportsFixer.php',
];
$ignoreErrors[] = [
'message' => '#^Method PhpCsFixer\\\\Fixer\\\\Import\\\\SingleImportPerStatementFixer\\:\\:getGroupDeclaration\\(\\) return type has no value type specified in iterable type array\\.$#',
'count' => 1,
Expand Down
4 changes: 2 additions & 2 deletions src/Fixer/Import/OrderedImportsFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ private function sortAlphabetically(array $first, array $second): int
$firstNamespace = str_replace('\\', ' ', $this->prepareNamespace($first['namespace']));
$secondNamespace = str_replace('\\', ' ', $this->prepareNamespace($second['namespace']));

return $this->configuration['case_sensitive']
return true === $this->configuration['case_sensitive']
? strcmp($firstNamespace, $secondNamespace)
: strcasecmp($firstNamespace, $secondNamespace);
}
Expand All @@ -310,7 +310,7 @@ private function sortByLength(array $first, array $second): int
$secondNamespaceLength = \strlen($secondNamespace);

if ($firstNamespaceLength === $secondNamespaceLength) {
$sortResult = $this->configuration['case_sensitive']
$sortResult = true === $this->configuration['case_sensitive']
? strcmp($firstNamespace, $secondNamespace)
: strcasecmp($firstNamespace, $secondNamespace);
} else {
Expand Down

0 comments on commit eb537a6

Please sign in to comment.