Skip to content

Commit 0cecb44

Browse files
committed
Fix linter issues
1 parent 8e1afc3 commit 0cecb44

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/Type/LowercaseString.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ private function isLowerString(string $value): bool
3535
return true;
3636
}
3737

38-
if (\function_exists('\\ctype_lower')) {
39-
return \ctype_lower($value);
38+
if (\function_exists('\\ctype_upper')) {
39+
return !\ctype_upper($value);
4040
}
4141

42-
return !\preg_match('/[^a-z]/', $value);
42+
return \preg_match('/[A-Z]/', $value) <= 0;
4343
}
4444

4545
public function cast(mixed $value, Context $context): string

src/Type/NonZeroIntType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function cast(mixed $value, Context $context): int
3737
$coerced = $this->coercer->coerce($value, $context);
3838
}
3939

40-
if (\is_int($value) && $value !== 0) {
40+
if (\is_int($coerced) && $coerced !== 0) {
4141
return $coerced;
4242
}
4343

src/Type/UppercaseString.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ private function isUpperString(string $value): bool
3535
return true;
3636
}
3737

38-
if (\function_exists('\\ctype_upper')) {
39-
return \ctype_upper($value);
38+
if (\function_exists('\\ctype_lower')) {
39+
return !\ctype_lower($value);
4040
}
4141

42-
return !\preg_match('/[^A-Z]/', $value);
42+
return \preg_match('/[a-z]/', $value) <= 0;
4343
}
4444

4545
public function cast(mixed $value, Context $context): string

0 commit comments

Comments
 (0)