refactored State pattern example

This commit is contained in:
Dominik Liebler
2018-06-14 22:49:28 +02:00
parent ea85485b85
commit 93d4ebf90f
11 changed files with 133 additions and 113 deletions

View File

@@ -1,26 +0,0 @@
<?php
namespace DesignPatterns\Behavioral\State;
class ContextOrder extends StateOrder
{
public function getState():StateOrder
{
return static::$state;
}
public function setState(StateOrder $state)
{
static::$state = $state;
}
public function done()
{
static::$state->done();
}
public function getStatus(): string
{
return static::$state->getStatus();
}
}