mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-10 17:04:01 +02:00
refactored State pattern example
This commit is contained in:
16
Behavioral/State/StateDone.php
Normal file
16
Behavioral/State/StateDone.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace DesignPatterns\Behavioral\State;
|
||||
|
||||
class StateDone implements State
|
||||
{
|
||||
public function proceedToNext(OrderContext $context)
|
||||
{
|
||||
// there is nothing more to do
|
||||
}
|
||||
|
||||
public function toString(): string
|
||||
{
|
||||
return 'done';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user