diff --git a/app/Services/PdfMaker/Designs/Plain.php b/app/Services/PdfMaker/Designs/Plain.php index b300ee058e85..33d6f7cd605c 100644 --- a/app/Services/PdfMaker/Designs/Plain.php +++ b/app/Services/PdfMaker/Designs/Plain.php @@ -12,11 +12,11 @@ namespace App\Services\PdfMaker\Designs; +use App\Services\PdfMaker\Designs\Utilities\BaseDesign; use App\Services\PdfMaker\Designs\Utilities\BuildTableHeader; -use App\Services\PdfMaker\Designs\Utilities\DesignInterface; use App\Utils\Traits\MakesInvoiceValues; -class Plain implements DesignInterface +class Plain extends BaseDesign { use MakesInvoiceValues, BuildTableHeader; @@ -39,17 +39,6 @@ class Plain implements DesignInterface ); } - public function setup(): void - { - if (isset($this->context['client'])) { - $this->client = $this->context['client']; - } - - if (isset($this->context['invoice'])) { - $this->invoice = $this->context['invoice']; - } - } - public function elements(array $context): array { $this->context = $context; diff --git a/app/Services/PdfMaker/Designs/Utilities/DesignInterface.php b/app/Services/PdfMaker/Designs/Utilities/BaseDesign.php similarity index 52% rename from app/Services/PdfMaker/Designs/Utilities/DesignInterface.php rename to app/Services/PdfMaker/Designs/Utilities/BaseDesign.php index 07f1cf376341..36e36b474640 100644 --- a/app/Services/PdfMaker/Designs/Utilities/DesignInterface.php +++ b/app/Services/PdfMaker/Designs/Utilities/BaseDesign.php @@ -12,17 +12,16 @@ namespace App\Services\PdfMaker\Designs\Utilities; -interface DesignInterface +class BaseDesign { - public function html(): ?string; + public function setup(): void + { + if (isset($this->context['client'])) { + $this->client = $this->context['client']; + } - public function setup(): void; - - public function elements(array $context): array; - - public function productTable(): array; - - public function buildTableHeader(): array; - - public function buildTableBody(): array; + if (isset($this->context['invoice'])) { + $this->invoice = $this->context['invoice']; + } + } }