Fix status call in andX and orX

This commit is contained in:
Anton Vakhrushev 2017-03-10 06:45:20 +03:00
parent 4268ea02d3
commit 843f16ae0c

View File

@ -91,11 +91,11 @@ class Reason
*/
public function andX(Reason $other): self
{
if ($other->getStatus()->getWeight() > $this->status->getWeight()) {
if ($other->status->getWeight() > $this->status->getWeight()) {
return clone $other;
}
if ($other->getStatus()->getWeight() === $this->status->getWeight()) {
if ($other->status->getWeight() === $this->status->getWeight()) {
return $this->withMessages($other->getMessages());
}
@ -117,11 +117,11 @@ class Reason
*/
public function orX(Reason $other): self
{
if ($other->getStatus()->getWeight() < $this->status->getWeight()) {
if ($other->status->getWeight() < $this->status->getWeight()) {
return clone $other;
}
if ($other->getStatus()->getWeight() === $this->status->getWeight()) {
if ($other->status->getWeight() === $this->status->getWeight()) {
return $this->withMessages($other->getMessages());
}