From 267da38c6bb26c5b5774faa634883cb6ff971e5d Mon Sep 17 00:00:00 2001 From: philipp lang Date: Fri, 13 Dec 2024 02:46:44 +0100 Subject: [PATCH] Lint --- .../Documents/CityRemscheidDocument.php | 13 ++----------- .../Documents/GallierDocument.php | 13 ++----------- app/Contribution/Traits/FormatsDates.php | 19 +++++++++++++++++++ resources/views/tex/contribution/gallier.tex | 4 ++-- 4 files changed, 25 insertions(+), 24 deletions(-) create mode 100644 app/Contribution/Traits/FormatsDates.php diff --git a/app/Contribution/Documents/CityRemscheidDocument.php b/app/Contribution/Documents/CityRemscheidDocument.php index 406d3d58..d97b2162 100644 --- a/app/Contribution/Documents/CityRemscheidDocument.php +++ b/app/Contribution/Documents/CityRemscheidDocument.php @@ -3,15 +3,16 @@ namespace App\Contribution\Documents; use App\Contribution\Data\MemberData; +use App\Contribution\Traits\FormatsDates; use App\Contribution\Traits\HasPdfBackground; use App\Country; use App\Member\Member; -use Carbon\Carbon; use Illuminate\Support\Collection; class CityRemscheidDocument extends ContributionDocument { use HasPdfBackground; + use FormatsDates; /** * @param Collection> $leaders @@ -31,16 +32,6 @@ class CityRemscheidDocument extends ContributionDocument $this->setEventName($eventName); } - public function niceDateFrom(): string - { - return Carbon::parse($this->dateFrom)->format('d.m.Y'); - } - - public function niceDateUntil(): string - { - return Carbon::parse($this->dateUntil)->format('d.m.Y'); - } - /** * {@inheritdoc} */ diff --git a/app/Contribution/Documents/GallierDocument.php b/app/Contribution/Documents/GallierDocument.php index 954a8769..46be4f95 100644 --- a/app/Contribution/Documents/GallierDocument.php +++ b/app/Contribution/Documents/GallierDocument.php @@ -3,15 +3,16 @@ namespace App\Contribution\Documents; use App\Contribution\Data\MemberData; +use App\Contribution\Traits\FormatsDates; use App\Contribution\Traits\HasPdfBackground; use App\Country; -use Carbon\Carbon; use Illuminate\Support\Collection; class GallierDocument extends ContributionDocument { use HasPdfBackground; + use FormatsDates; /** * @param Collection> $members @@ -29,16 +30,6 @@ class GallierDocument extends ContributionDocument $this->setEventName($eventName); } - public function dateFromHuman(): string - { - return Carbon::parse($this->dateFrom)->format('d.m.Y'); - } - - public function dateUntilHuman(): string - { - return Carbon::parse($this->dateUntil)->format('d.m.Y'); - } - /** * {@inheritdoc} */ diff --git a/app/Contribution/Traits/FormatsDates.php b/app/Contribution/Traits/FormatsDates.php new file mode 100644 index 00000000..bc2f9360 --- /dev/null +++ b/app/Contribution/Traits/FormatsDates.php @@ -0,0 +1,19 @@ +dateFrom)->format('d.m.Y'); + } + + public function niceDateUntil(): string + { + return Carbon::parse($this->dateUntil)->format('d.m.Y'); + } +} diff --git a/resources/views/tex/contribution/gallier.tex b/resources/views/tex/contribution/gallier.tex index 0fe8169c..bd35c06e 100644 --- a/resources/views/tex/contribution/gallier.tex +++ b/resources/views/tex/contribution/gallier.tex @@ -15,8 +15,8 @@ @foreach($members as $chunk) \begin{tikzpicture}[remember picture,overlay,yscale=-1] -\node[anchor=base west] at (17mm,29.62mm) {\bfseries{\small{<<<$dateFromHuman>>>}}}; -\node[anchor=base west] at (34mm,29.62mm) {\bfseries{\small{<<<$dateUntilHuman>>>}}}; +\node[anchor=base west] at (17mm,29.62mm) {\bfseries{\small{<<<$niceDateFrom>>>}}}; +\node[anchor=base west] at (34mm,29.62mm) {\bfseries{\small{<<<$niceDateUntil>>>}}}; \node[] at (203mm,15.55mm) {\bfseries{\small{<<<$zipLocation>>>}}}; \node[thick, cross out,draw=black,text width=2.4mm, text height=2.4mm, inner sep=0mm] at (17.76mm,47.10mm) {};