Commit eff9ee4d authored by Jan Kuchař's avatar Jan Kuchař

Enum::equals(): allow comparing only enum-enum instances (this prevents typo,...

Enum::equals(): allow comparing only enum-enum instances (this prevents typo, when comparing to scalar value)
parent 791dc99a
Pipeline #14350 passed with stages
in 44 seconds
......@@ -125,11 +125,11 @@ abstract class Enum
}
/**
* @param mixed $that the other object we are comparing to
* @param Enum $that the other object we are comparing to
* @return bool if current value equals to the other value
* If value is non-enum value, returns false (as they are also not equal).
*/
public function equals($that): bool
public function equals(Enum $that): bool
{
return $this === $that;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment