I apologize ahead of time. I couldn’t figure out how to upload my testing screenshots. I’ve tried testing this code numerous times to no avail. I’ve even tried looking at solutions that have passed and can’t seem to get it to work. Can someone kindly take a look and see if you can pinpoint what’s happening?
ProgramWindow.php
<?php
class ProgramWindow
{
public $x;
public $y;
public $width;
public $height;
function __construct()
{
$this->x = 0;
$this->y = 0;
$this->width = 800;
$this->height = 600;
}
function resize(Size $size) {
$this->width = $size->width;
$this->height = $size->height;
}
function move(Position $position) {
$this->x = $position->x;
$this->y = $position->y;
}
}
Size.php
<?php
class Size
{
public $height;
public $width;
function __construct($newHeight, $newWidth) {
$this->height = $newHeight;
$this->width = $newWidth;
}
}
Position.php
<?php
class Position
{
public $x;
public $y;
function __construct($newX, $newY)
{
$this->x = $newX;
$this->y = $newY;
}
}