From 034386aa59dcd0c418ea75b93d805dd96cc712f4 Mon Sep 17 00:00:00 2001 From: Ramon Gutierrez Date: Wed, 31 Jan 2018 13:35:10 +0800 Subject: [PATCH] Set all name value pair collections to extend from generic class --- src/Ramcar/ServiceType.php | 17 +---------------- src/Ramcar/TicketStatus.php | 17 +---------------- src/Ramcar/TicketType.php | 17 +---------------- 3 files changed, 3 insertions(+), 48 deletions(-) diff --git a/src/Ramcar/ServiceType.php b/src/Ramcar/ServiceType.php index f349da21..c2d657e7 100644 --- a/src/Ramcar/ServiceType.php +++ b/src/Ramcar/ServiceType.php @@ -2,7 +2,7 @@ namespace App\Ramcar; -class ServiceType +class ServiceType extends NameValue { const BATTERY_REPLACEMENT_NEW = 'battery_new'; const BATTERY_REPLACEMENT_WARRANTY = 'battery_warranty'; @@ -17,19 +17,4 @@ class ServiceType 'overheat' => 'Overheat Assistance', 'fuel' => 'Emergency Refuel', ]; - - - static public function getCollection() - { - return self::COLLECTION; - } - - static public function validate($type_text) - { - if (isset(self::COLLECTION[$type_text])) - return true; - - return false; - } - } diff --git a/src/Ramcar/TicketStatus.php b/src/Ramcar/TicketStatus.php index 9a129b5c..138bdb42 100644 --- a/src/Ramcar/TicketStatus.php +++ b/src/Ramcar/TicketStatus.php @@ -2,7 +2,7 @@ namespace App\Ramcar; -class TicketStatus +class TicketStatus extends NameValue { const FILED = 'filed'; const ACKNOWLEDGED = 'acknowledged'; @@ -13,19 +13,4 @@ class TicketStatus 'acknowledged' => 'Acknowledged', 'closed' => 'Closed', ]; - - - static public function getCollection() - { - return self::COLLECTION; - } - - static public function validate($type_text) - { - if (isset(self::COLLECTION[$type_text])) - return true; - - return false; - } - } diff --git a/src/Ramcar/TicketType.php b/src/Ramcar/TicketType.php index a49916ce..8483d25b 100644 --- a/src/Ramcar/TicketType.php +++ b/src/Ramcar/TicketType.php @@ -2,7 +2,7 @@ namespace App\Ramcar; -class TicketType +class TicketType extends NameValue { const COMPLAINT = 'complaint'; const QUESTION = 'question'; @@ -17,19 +17,4 @@ class TicketType 'billing' => 'Billing', 'other' => 'Other', ]; - - - static public function getCollection() - { - return self::COLLECTION; - } - - static public function validate($type_text) - { - if (isset(self::COLLECTION[$type_text])) - return true; - - return false; - } - }