fix: classes renaming to correspond to UML diagram

This commit is contained in:
Mathieu
2024-04-18 11:23:38 +02:00
parent 13af79cc5e
commit 3a8af1c42f
6 changed files with 20 additions and 20 deletions

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\State;
class ContextOrder
{
private StateOrder $state;
public static function create(): ContextOrder
{
$order = new self();
$order->state = new CreateOrder();
return $order;
}
public function setState(StateOrder $state)
{
$this->state = $state;
}
public function proceedToNext()
{
$this->state->proceedToNext($this);
}
public function toString()
{
return $this->state->toString();
}
}