Skip to content

Commit 3fd03ed

Browse files
committed
Fix method comparison
1 parent 27e84ed commit 3fd03ed

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/Component/Method/MethodImpl.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,26 @@
1111
*/
1212
trait MethodImpl
1313
{
14+
/**
15+
* @var non-empty-uppercase-string
16+
*/
17+
public readonly string $name;
18+
19+
/**
20+
* @param non-empty-string $name
21+
*/
1422
public function __construct(
15-
/**
16-
* @var non-empty-uppercase-string
17-
*/
18-
public readonly string $name,
23+
string $name,
1924
public readonly ?bool $isIdempotent = null,
2025
public readonly ?bool $isSafe = null,
21-
) {}
26+
) {
27+
$this->name = \strtoupper($name);
28+
}
2229

2330
public function equals(mixed $other): bool
2431
{
2532
return $other === $this
26-
|| ($other instanceof self
33+
|| ($other instanceof MethodInterface
2734
&& $other->name === $this->name);
2835
}
2936

0 commit comments

Comments
 (0)