Skip to content

Commit 69e8de2

Browse files
committed
ci: Fix psalm issues
1 parent 2facc88 commit 69e8de2

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

Inpsyde/Sniffs/CodeQuality/ArgumentTypeDeclarationSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private function isMixed(string $paramName, array $docBlockTypes): bool
113113
}
114114

115115
$paramDocBlockTypesCount = count($paramDocBlockTypes);
116-
if (!$paramDocBlockTypesCount || $paramDocBlockTypesCount > 2) {
116+
if ($paramDocBlockTypesCount !== 1 && $paramDocBlockTypesCount !== 2) {
117117
return false;
118118
}
119119

Inpsyde/Sniffs/CodeQuality/ElementNameMinimalLengthSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function process(File $file, $position)
7878
// phpcs:enable Inpsyde.CodeQuality.ReturnTypeDeclaration
7979

8080
$elementName = PhpcsHelpers::tokenName($file, $position);
81-
$elementNameLength = (int)mb_strlen($elementName);
81+
$elementNameLength = mb_strlen($elementName);
8282

8383
if ($this->shouldBeSkipped($elementNameLength, $elementName)) {
8484
return;

Inpsyde/Sniffs/CodeQuality/LineLengthSniff.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,12 @@ private function isLongWord(File $file, array $tokens, int $start, int $end): bo
183183
? $this->isLongHtmlAttribute($start, $end, $file, $tokens)
184184
: $this->isLongSingleWord($start, $end, $file, $tokens);
185185

186-
if (!$isLong || $isHtml) {
187-
return $isLong && $isHtml;
186+
if (!$isLong) {
187+
return false;
188+
}
189+
190+
if ($isHtml) {
191+
return true;
188192
}
189193

190194
$start++;

Inpsyde/Sniffs/CodeQuality/ReturnTypeDeclarationSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ private function hasReturnNullOrMixedDocBloc(File $file, int $functionPosition):
328328
$returnTypes = array_map('trim', $returnTypes);
329329
$returnTypesCount = count($returnTypes);
330330
// Only if 1 or 2 types
331-
if (!$returnTypesCount || ($returnTypesCount > 2)) {
331+
if ($returnTypesCount !== 1 && $returnTypesCount !== 2) {
332332
return ['mixed' => false, 'null' => false];
333333
}
334334

0 commit comments

Comments
 (0)