mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-01 12:40:11 +02:00
PHP8
This commit is contained in:
@@ -4,11 +4,8 @@ namespace DesignPatterns\Behavioral\Memento;
|
||||
|
||||
class Memento
|
||||
{
|
||||
private State $state;
|
||||
|
||||
public function __construct(State $stateToSave)
|
||||
public function __construct(private State $state)
|
||||
{
|
||||
$this->state = $stateToSave;
|
||||
}
|
||||
|
||||
public function getState(): State
|
||||
|
@@ -4,7 +4,7 @@ namespace DesignPatterns\Behavioral\Memento;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
||||
class State
|
||||
class State implements \Stringable
|
||||
{
|
||||
const STATE_CREATED = 'created';
|
||||
const STATE_OPENED = 'opened';
|
||||
|
Reference in New Issue
Block a user