From cb933d10a514ac5ee407b7b40b53bb1c5a36645f Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Mon, 4 Sep 2017 20:32:02 +0300 Subject: [PATCH] rename rectangleAreaVerifier to areaVerifier --- README.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index f0136a8..159c123 100644 --- a/README.md +++ b/README.md @@ -1181,7 +1181,7 @@ class Square extends Rectangle } } -function rectangleAreaVerifier(Rectangle $rectangle) +function areaVerifier(Rectangle $rectangle) { $rectangle->setWidth(4); $rectangle->setHeight(5); @@ -1193,7 +1193,7 @@ function rectangleAreaVerifier(Rectangle $rectangle) $rectangles = [new Rectangle(), new Square()]; foreach ($rectangles as $rectangle) { - if (!rectangleAreaVerifier($rectangle)) { +    if (!areaVerifier($rectangle)) { throw new Exception('Bad area!'); } } @@ -1258,20 +1258,16 @@ function squareAreaVerifier(Square $square) return $square->area() == 25; } -$rectangles = [new Rectangle()]; +$rectangle = new Rectangle(); -foreach ($rectangles as $rectangle) { - if (!rectangleAreaVerifier($rectangle)) { - throw new Exception('Bad area!'); - } +if (!rectangleAreaVerifier($rectangle)) { + throw new Exception('Bad area!'); } -$squares = [new Square()]; +$square = new Square(); -foreach ($squares as $square) { - if (!squareAreaVerifier($square)) { - throw new Exception('Bad area!'); - } +if (!squareAreaVerifier($square)) { + throw new Exception('Bad area!'); } ```