Skip to content

Commit 776d4c2

Browse files
committed
Remove unnecessary check in sctructural example of Memento
1 parent 8b79b6d commit 776d4c2

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/RefactoringGuru/Memento/Structural/MementoStructural.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ public function save(): Memento
9393
*/
9494
public function restore(Memento $memento): void
9595
{
96-
if (! $memento instanceof ConcreteMemento) {
97-
throw new \Exception("Unknown memento class ".get_class($memento));
98-
}
99-
10096
$this->state = $memento->getState();
10197
echo "Originator: My state has changed to: {$this->state}\n";
10298
}

0 commit comments

Comments
 (0)