mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-09 00:16:32 +02:00
State pattern is maintainable
state pattern change readme.rst
This commit is contained in:
26
Behavioral/State/ContextOrder.php
Normal file
26
Behavioral/State/ContextOrder.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user