mirror of
https://github.com/jupeter/clean-code-php.git
synced 2025-09-26 05:59:04 +02:00
rename rectangleAreaVerifier to areaVerifier
This commit is contained in:
12
README.md
12
README.md
@@ -1181,7 +1181,7 @@ class Square extends Rectangle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function rectangleAreaVerifier(Rectangle $rectangle)
|
function areaVerifier(Rectangle $rectangle)
|
||||||
{
|
{
|
||||||
$rectangle->setWidth(4);
|
$rectangle->setWidth(4);
|
||||||
$rectangle->setHeight(5);
|
$rectangle->setHeight(5);
|
||||||
@@ -1193,7 +1193,7 @@ function rectangleAreaVerifier(Rectangle $rectangle)
|
|||||||
$rectangles = [new Rectangle(), new Square()];
|
$rectangles = [new Rectangle(), new Square()];
|
||||||
|
|
||||||
foreach ($rectangles as $rectangle) {
|
foreach ($rectangles as $rectangle) {
|
||||||
if (!rectangleAreaVerifier($rectangle)) {
|
if (!areaVerifier($rectangle)) {
|
||||||
throw new Exception('Bad area!');
|
throw new Exception('Bad area!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1258,21 +1258,17 @@ function squareAreaVerifier(Square $square)
|
|||||||
return $square->area() == 25;
|
return $square->area() == 25;
|
||||||
}
|
}
|
||||||
|
|
||||||
$rectangles = [new Rectangle()];
|
$rectangle = new Rectangle();
|
||||||
|
|
||||||
foreach ($rectangles as $rectangle) {
|
|
||||||
if (!rectangleAreaVerifier($rectangle)) {
|
if (!rectangleAreaVerifier($rectangle)) {
|
||||||
throw new Exception('Bad area!');
|
throw new Exception('Bad area!');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$squares = [new Square()];
|
$square = new Square();
|
||||||
|
|
||||||
foreach ($squares as $square) {
|
|
||||||
if (!squareAreaVerifier($square)) {
|
if (!squareAreaVerifier($square)) {
|
||||||
throw new Exception('Bad area!');
|
throw new Exception('Bad area!');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**[⬆ back to top](#table-of-contents)**
|
**[⬆ back to top](#table-of-contents)**
|
||||||
|
Reference in New Issue
Block a user