mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-09-25 22:09:23 +02:00
28 lines
411 B
PHP
28 lines
411 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace DesignPatterns\Behavioral\Memento;
|
|
|
|
class Memento
|
|
{
|
|
/**
|
|
* @var State
|
|
*/
|
|
private $state;
|
|
|
|
/**
|
|
* @param State $stateToSave
|
|
*/
|
|
public function __construct(State $stateToSave)
|
|
{
|
|
$this->state = $stateToSave;
|
|
}
|
|
|
|
/**
|
|
* @return State
|
|
*/
|
|
public function getState()
|
|
{
|
|
return $this->state;
|
|
}
|
|
}
|