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

@@ -0,0 +1,16 @@
<?php
namespace DesignPatterns\Behavioral\State;
class StateCreated implements State
{
public function proceedToNext(OrderContext $context)
{
$context->setState(new StateShipped());
}
public function toString(): string
{
return 'created';
}
}