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