State pattern is maintainable

state pattern change readme.rst
This commit is contained in:
ko22009
2017-04-27 09:13:45 +05:00
parent bdf8c494f0
commit ad163dc353
10 changed files with 569 additions and 397 deletions

View File

@@ -0,0 +1,32 @@
<?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'];
}
}