diff --git a/concepts/class-basics/introduction.md b/concepts/class-basics/introduction.md index 79bc2f15..d5b92347 100644 --- a/concepts/class-basics/introduction.md +++ b/concepts/class-basics/introduction.md @@ -23,7 +23,7 @@ class Door Classes are instantiated with the `new` keyword, this allocates memory for the class instance and calls the classes constructor method. Instantiated classes may be assigned to a variable. -To invoke the methods of a class instance, we can use the `->` access operator +To invoke the methods of a class instance, we can use the `->` access operator. ```php color = $color; } - function getColor(): string + function getColor() { return $this->color; } @@ -59,5 +59,3 @@ $a_car = new Car("red"); $a_car->color; // => "red" by accessing the property $a_car->getColor(); // => "red" by invoking the instance method ``` - - diff --git a/exercises/concept/windowing-system/.docs/hints.md b/exercises/concept/windowing-system/.docs/hints.md index 6cef5b9a..7a1ad211 100644 --- a/exercises/concept/windowing-system/.docs/hints.md +++ b/exercises/concept/windowing-system/.docs/hints.md @@ -3,11 +3,12 @@ ## General - Revisit the [Objects Concept][concept-class-basics] if needed to fresh up on the basics. +- Carefully read the instructions for the parameter positioning of `x`, `y`, `width`, and `height`. These are easily confused. ## 1. Define a ProgramWindow class - Remember to use [class syntax][php-class] for this task. -- Define [properties][php-properties] by adding them to class declaration. +- Define [properties][php-properties] by adding them to the class declaration. ## 2. Define a constructor function for the ProgramWindow class diff --git a/exercises/concept/windowing-system/.docs/instructions.md b/exercises/concept/windowing-system/.docs/instructions.md index 6e52a1ec..cbef3de2 100755 --- a/exercises/concept/windowing-system/.docs/instructions.md +++ b/exercises/concept/windowing-system/.docs/instructions.md @@ -4,7 +4,7 @@ In this exercise, you will be simulating a windowing based computer system. You will create some windows that can be moved and resized. The following image is representative of the values you will be working with below. -``` +```text ╔════════════════════════════════════════════════════════════╗ ║ ║ ║ position::$x,_ ║ diff --git a/exercises/concept/windowing-system/.docs/introduction.md b/exercises/concept/windowing-system/.docs/introduction.md index 23ead1f6..da9f47fd 100644 --- a/exercises/concept/windowing-system/.docs/introduction.md +++ b/exercises/concept/windowing-system/.docs/introduction.md @@ -25,7 +25,7 @@ class Door Classes are instantiated with the `new` keyword, this allocates memory for the class instance and calls the classes constructor method. Instantiated classes may be assigned to a variable. -To invoke the methods of a class instance, we can use the `->` access operator +To invoke the methods of a class instance, we can use the `->` access operator. ```php color = $color; } - function getColor(): string + function getColor() { return $this->color; } diff --git a/exercises/concept/windowing-system/ProgramWindowTest.php b/exercises/concept/windowing-system/ProgramWindowTest.php index 52b634ff..40d3b3f0 100644 --- a/exercises/concept/windowing-system/ProgramWindowTest.php +++ b/exercises/concept/windowing-system/ProgramWindowTest.php @@ -74,17 +74,6 @@ public function testHasConstructorSettingInitialValues() $this->assertEquals(800, $window->width); } - /** - * @testdox assert Position class exists, with constructor, properties - * @task_id 3 - */ - public function testPositionHasConstructorSettingInitialValues() - { - $position = new Position(30, 70); - $this->assertEquals(30, $position->y); - $this->assertEquals(70, $position->x); - } - /** * @testdox assert Position class exists, with constructor, properties * @task_id 3 @@ -109,6 +98,17 @@ public function testProgramWindowResize() $this->assertEquals(2135, $window->width); } + /** + * @testdox assert Position class exists, with constructor, properties + * @task_id 4 + */ + public function testPositionHasConstructorSettingInitialValues() + { + $position = new Position(30, 70); + $this->assertEquals(30, $position->y); + $this->assertEquals(70, $position->x); + } + /** * @testdox assert ProgramWindow::move function exists * @task_id 4