mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-09 00:16:32 +02:00
refactored State pattern example
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user