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,32 +0,0 @@
<?php
namespace DesignPatterns\Behavioral\State;
abstract class StateOrder
{
/**
* @var array
*/
private $details;
/**
* @var StateOrder $state
*/
protected static $state;
/**
* @return mixed
*/
abstract protected function done();
protected function setStatus(string $status)
{
$this->details['status'] = $status;
$this->details['updatedTime'] = time();
}
protected function getStatus(): string
{
return $this->details['status'];
}
}