Skip to content

Commit

Permalink
PHP has no __equals method.
Browse files Browse the repository at this point in the history
  • Loading branch information
codecop committed Oct 25, 2023
1 parent bdbaad0 commit 23f2e6f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
4 changes: 0 additions & 4 deletions PHP/src/A/Money.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,4 @@ public function reduceBy(int $p): Money {
public function moreThan(Money $other): bool {
return $this->value->compareTo($other->value) > 0;
}

public function __equals($other): bool {
return $this->value->isEqualTo($other->value);
}
}
8 changes: 1 addition & 7 deletions PHP/src/C/Money.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,10 @@ public function percentage(int $p): Money {
}

public function format(): String {
return number_format($value->toFloat(), 2, '.', '');
}

public function __equals($other): bool {
return $this->value->isEqualTo($other->value);
return number_format($this->value->toFloat(), 2, '.', '');
}

public function asBigDecimal(): BigDecimal {
return $this->value;
}

}

8 changes: 1 addition & 7 deletions PHP/src/D/Money.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,10 @@ public function percentage(int $p): Money {
}

public function format(): String {
return number_format($value->toFloat(), 2, '.', '');
}

public function __equals($other): bool {
return $this->value->isEqualTo($other->value);
return number_format($this->value->toFloat(), 2, '.', '');
}

public function asBigDecimal(): BigDecimal {
return $this->value;
}

}

0 comments on commit 23f2e6f

Please sign in to comment.