From 7f4718c4da6e301a8a8b0a153b7d3af9483f9789 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 24 Apr 2023 19:53:13 +0200 Subject: [PATCH] Check directly against meta field name as we only have one This just makes it all clearer. If/when we add more meta fields, that's something we can revisit then. --- packages/publications/src/Models/PublicationType.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/publications/src/Models/PublicationType.php b/packages/publications/src/Models/PublicationType.php index 4e23ce6b901..ae29dc6b114 100644 --- a/packages/publications/src/Models/PublicationType.php +++ b/packages/publications/src/Models/PublicationType.php @@ -25,7 +25,6 @@ use function is_null; use function json_decode; use function json_encode; -use function str_starts_with; /** * @see \Hyde\Publications\Testing\Feature\PublicationTypeTest @@ -183,7 +182,7 @@ public function getFieldDefinition(string $fieldName): PublicationFieldDefinitio public function getCanonicalFieldDefinition(): PublicationFieldDefinition { - if (str_starts_with($this->canonicalField, '__')) { // Todo check directly against __createdAt + if ($this->canonicalField === '__createdAt') { return new PublicationFieldDefinition('string', $this->canonicalField); }