Skip to content

Commit 96c8936

Browse files
phpstan-botclaude
andcommitted
Shorten comments in looseCompare()
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 6d9684c commit 96c8936

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

src/Type/Accessory/AccessoryDecimalIntegerStringType.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -412,16 +412,12 @@ public function isScalar(): TrinaryLogic
412412
public function looseCompare(Type $type, PhpVersion $phpVersion): BooleanType
413413
{
414414
if ($this->inverse) {
415-
// A non-decimal-int-string may still be numeric ("02", "2.0", "1e1")
416-
// or empty (""), so it can be loosely equal to a decimal-int-string,
417-
// another numeric value or null. Nothing can be decided here.
415+
// may be numeric ("02", "2.0") or empty (""), so nothing is decidable
418416
return new BooleanType();
419417
}
420418

421-
// A decimal-int-string is a numeric string, so it compares like one:
422-
// numerically against other numeric strings (and numbers), and never
423-
// loosely equal to null (it is always non-empty) or to a non-numeric
424-
// string (that would be a byte-wise comparison that cannot match).
419+
// a decimal-int-string is a non-empty numeric string, so it compares
420+
// like one: never loosely equal to null or to a non-numeric string
425421
if ($type->isNull()->yes()) {
426422
return new ConstantBooleanType(false);
427423
}

0 commit comments

Comments
 (0)