From a9f8ebcc1010da7ba2ba7f0d6356f2852f7773b3 Mon Sep 17 00:00:00 2001 From: Steve Chaloner Date: Tue, 12 Nov 2024 17:20:32 +0100 Subject: [PATCH] Remove update chart key for event (#135) Updating the chart key of an event is no longer documented but is still supported by the client libraries. This PR removes the parameter from `UpdateEventParams`. Co-authored-by: Steve Chaloner --- src/Events/Events.php | 4 ---- src/Events/UpdateEventParams.php | 5 ----- tests/Events/UpdateEventTest.php | 13 ------------- 3 files changed, 22 deletions(-) diff --git a/src/Events/Events.php b/src/Events/Events.php index 767f355..468a45e 100644 --- a/src/Events/Events.php +++ b/src/Events/Events.php @@ -145,10 +145,6 @@ public function update(string $eventKey, UpdateEventParams $params): void { $request = new stdClass(); - if ($params->chartKey !== null) { - $request->chartKey = $params->chartKey; - } - if ($params->eventKey !== null) { $request->eventKey = $params->eventKey; } diff --git a/src/Events/UpdateEventParams.php b/src/Events/UpdateEventParams.php index 2c8a4f4..92b7d8b 100644 --- a/src/Events/UpdateEventParams.php +++ b/src/Events/UpdateEventParams.php @@ -4,11 +4,6 @@ class UpdateEventParams extends EventParams { - /** - * @var string - */ - public $chartKey; - /** * @var bool */ diff --git a/tests/Events/UpdateEventTest.php b/tests/Events/UpdateEventTest.php index 143ecb9..6cea2d9 100644 --- a/tests/Events/UpdateEventTest.php +++ b/tests/Events/UpdateEventTest.php @@ -11,19 +11,6 @@ class UpdateEventTest extends SeatsioClientTest { - public function testUpdateChartKey() - { - $chart1 = $this->seatsioClient->charts->create(); - $chart2 = $this->seatsioClient->charts->create(); - $event = $this->seatsioClient->events->create($chart1->key); - - $this->seatsioClient->events->update($event->key, UpdateEventParams::create()->setChartKey($chart2->key)); - - $retrievedEvent = $this->seatsioClient->events->retrieve($event->key); - self::assertEquals($chart2->key, $retrievedEvent->chartKey); - self::assertNotNull($retrievedEvent->updatedOn); - } - public function testUpdateIsInThePast() { $chart = $this->seatsioClient->charts->create();