12345678910111213141516171819202122232425262728293031323334 |
- <?php
- /**
- * Created by PhpStorm.
- * User: mrs
- * Date: 28.12.2017
- * Time: 9:27
- */
- require_once('AbstractCoordinates.php');
- class Point extends Coordinates
- {
- public $x = 0;
- public $y = 0;
- public function __construct(int $x, int $y)
- {
- $this->x = $x;
- $this->y = $y;
- }
- public function getCoordinates(): array
- {
- $point['x'] = $this->x;
- $point['y'] = $this->y;
- return $point;
- }
- public function printCoordinates(): void
- {
- echo "Координаты точки: х = " . $this->x . " y = " . $this->y;
- }
- }
|