From 1e02e96ebaac04473094ad73079aa42a2489cf6c Mon Sep 17 00:00:00 2001 From: mitsuha_s Date: Sun, 23 Jul 2023 14:43:24 +0300 Subject: [PATCH] PasteFormData->fromPaste private method added --- src/DTO/PasteFormData.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/DTO/PasteFormData.php b/src/DTO/PasteFormData.php index f37ddba..d51d25b 100644 --- a/src/DTO/PasteFormData.php +++ b/src/DTO/PasteFormData.php @@ -20,10 +20,15 @@ class PasteFormData public function __construct(?Paste $paste = null) { - if ($paste === null) - { + if ($paste === null) { return; } + + $this->fromPaste($paste); + } + + private function fromPaste(Paste $paste) + { $this->text = $paste->text; $this->private = $paste->secret !== null; $this->language = $paste->language;