From a94e0020551140b5f89dcb161203b385587ce8f0 Mon Sep 17 00:00:00 2001 From: edalzell Date: Wed, 15 Jul 2026 21:39:29 -0700 Subject: [PATCH 1/2] remove dead code --- src/Events.php | 23 ----------------------- src/Tags/Events.php | 15 --------------- tests/TestCase.php | 5 ----- 3 files changed, 43 deletions(-) diff --git a/src/Events.php b/src/Events.php index 99f488d..13c4742 100644 --- a/src/Events.php +++ b/src/Events.php @@ -34,8 +34,6 @@ class Events private ?int $perPage = null; - private ?string $site = null; - private string $sort = 'asc'; private ?string $timezone = null; @@ -50,11 +48,6 @@ public static function fromCollection(string $handle): self return new static(new Parameters(['collection' => $handle])); } - public static function fromEntry(string $id): self - { - return new static(new Parameters(['event' => $id])); - } - public function __construct(Parameters $params) { throw_if( @@ -102,15 +95,6 @@ public function event(?string $id = null): self return $this; } - public function filters(array $filters): self - { - foreach ($filters as $fieldCondition => $value) { - $this->filter($fieldCondition, $value); - } - - return $this; - } - public function filter(string $fieldCondition, $value): self { $this->params->put($fieldCondition, $value); @@ -144,13 +128,6 @@ public function params(Collection $params): self return $this; } - public function site(?string $handle = null): self - { - $this->site = $handle; - - return $this; - } - public function sort(string $direction): self { $this->sort = $direction; diff --git a/src/Tags/Events.php b/src/Tags/Events.php index 1a18b7a..bf35d7c 100755 --- a/src/Tags/Events.php +++ b/src/Tags/Events.php @@ -9,10 +9,8 @@ use Carbon\CarbonPeriodImmutable; use Closure; use Illuminate\Support\Collection; -use Statamic\Contracts\Query\Builder; use Statamic\Entries\Entry; use Statamic\Entries\EntryCollection; -use Statamic\Facades\Compare; use Statamic\Facades\Site; use Statamic\Support\Arr; use Statamic\Tags\Concerns\OutputsItems; @@ -157,19 +155,6 @@ private function day(string $date, EntryCollection $occurrences): array ]; } - private function explodeTerms(array|Builder|string $terms): array - { - if (is_string($terms)) { - return array_filter(explode('|', $terms)); - } - - if (Compare::isQueryBuilder($terms)) { - return $terms->get(); - } - - return $terms; - } - private function generator(): Generator { return new Generator($this->params); diff --git a/tests/TestCase.php b/tests/TestCase.php index be5d962..a6c3633 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -7,7 +7,6 @@ use Statamic\Facades\Fieldset; use Statamic\Facades\Taxonomy; use Statamic\Facades\Term; -use Statamic\Fields\Blueprint; use Statamic\Fields\BlueprintRepository; use Statamic\Statamic; use Statamic\Testing\AddonTestCase; @@ -20,12 +19,8 @@ abstract class TestCase extends AddonTestCase protected string $addonServiceProvider = ServiceProvider::class; - protected $shouldFakeVersion = true; - protected Collection $collection; - protected Blueprint $blueprint; - protected function setUp(): void { parent::setUp(); From 599a780a6ecaf30ce7dc59f489636d092bca9683 Mon Sep 17 00:00:00 2001 From: edalzell Date: Thu, 16 Jul 2026 09:21:59 -0700 Subject: [PATCH 2/2] =?UTF-8?q?it=E2=80=99s=20public,=20can=E2=80=99t=20re?= =?UTF-8?q?move?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Events.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Events.php b/src/Events.php index 13c4742..16b99f3 100644 --- a/src/Events.php +++ b/src/Events.php @@ -48,6 +48,11 @@ public static function fromCollection(string $handle): self return new static(new Parameters(['collection' => $handle])); } + public static function fromEntry(string $id): self + { + return new static(new Parameters(['event' => $id])); + } + public function __construct(Parameters $params) { throw_if(