mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-17 20:21:15 +02:00
PHP7 Memento
This commit is contained in:
@@ -4,19 +4,21 @@ namespace DesignPatterns\Behavioral\Memento;
|
||||
|
||||
class Memento
|
||||
{
|
||||
/* @var mixed */
|
||||
/**
|
||||
* @var State
|
||||
*/
|
||||
private $state;
|
||||
|
||||
/**
|
||||
* @param mixed $stateToSave
|
||||
* @param State $stateToSave
|
||||
*/
|
||||
public function __construct($stateToSave)
|
||||
public function __construct(State $stateToSave)
|
||||
{
|
||||
$this->state = $stateToSave;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
* @return State
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
|
Reference in New Issue
Block a user