Skip to content

Commit f26a48a

Browse files
authored
Merge pull request #53 from luislard/fix_qa
Fix qa
2 parents 33df1cf + 69e8de2 commit f26a48a

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
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/NoAccessorsSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public function register()
5050
* phpcs:disable Inpsyde.CodeQuality.ArgumentTypeDeclaration
5151
* phpcs:disable Inpsyde.CodeQuality.ReturnTypeDeclaration
5252
* phpcs:disable Inpsyde.CodeQuality.FunctionLength
53+
* phpcs:disable Generic.Metrics.CyclomaticComplexity.TooHigh
5354
*/
5455
public function process(File $file, $position)
5556
{

Inpsyde/Sniffs/CodeQuality/ReturnTypeDeclarationSniff.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ public function process(File $file, $position)
116116
* @param File $file
117117
* @param int $position
118118
* @return void
119+
*
120+
* phpcs:disable Generic.Metrics.CyclomaticComplexity.TooHigh
119121
*/
120122
private function maybeErrors(
121123
bool $hasNonVoidReturnType,
@@ -326,7 +328,7 @@ private function hasReturnNullOrMixedDocBloc(File $file, int $functionPosition):
326328
$returnTypes = array_map('trim', $returnTypes);
327329
$returnTypesCount = count($returnTypes);
328330
// Only if 1 or 2 types
329-
if (!$returnTypesCount || ($returnTypesCount > 2)) {
331+
if ($returnTypesCount !== 1 && $returnTypesCount !== 2) {
330332
return ['mixed' => false, 'null' => false];
331333
}
332334

psalm.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
useDocblockPropertyTypes="true"
66
usePhpDocMethodsWithoutMagicCall="true"
77
strictBinaryOperands="true"
8-
allowPhpStormGenerics="true"
98
ignoreInternalFunctionFalseReturn="false"
109
ignoreInternalFunctionNullReturn="false"
1110
hideExternalErrors="true"

0 commit comments

Comments
 (0)