From b293ad9616e2e02894e2817422a38c44224861df Mon Sep 17 00:00:00 2001 From: Ben Parizek Date: Wed, 18 Mar 2020 17:21:12 -0400 Subject: [PATCH] Code cleanup --- src/SproutFields.php | 7 ------- src/fields/Address.php | 2 ++ src/fields/Email.php | 3 +++ src/fields/Gender.php | 4 ++-- src/fields/Name.php | 3 +++ src/fields/Phone.php | 3 +++ src/fields/Predefined.php | 9 ++------- src/fields/PredefinedDate.php | 6 ------ src/fields/RegularExpression.php | 3 +++ src/fields/Url.php | 6 ++++-- ...000_add_predefined_data_type_setting_sproutfields.php | 6 +----- ...and_standalone_predefined_date_field_sproutfields.php | 6 +----- src/translations/en/sprout-fields.php | 3 ++- 13 files changed, 26 insertions(+), 35 deletions(-) diff --git a/src/SproutFields.php b/src/SproutFields.php index e48c563..f8d2e9d 100644 --- a/src/SproutFields.php +++ b/src/SproutFields.php @@ -1,9 +1,4 @@ types[] = PredefinedField::class; $event->types[] = PredefinedDateField::class; $event->types[] = RegularExpressionField::class; - $event->types[] = TemplateField::class; $event->types[] = UrlField::class; }); diff --git a/src/fields/Address.php b/src/fields/Address.php index fe543e3..49c7ac5 100644 --- a/src/fields/Address.php +++ b/src/fields/Address.php @@ -78,6 +78,7 @@ public static function hasContentColumn(): bool * @throws RuntimeError * @throws SyntaxError * @throws SiteNotFoundException + * @throws \yii\base\Exception */ public function getSettingsHtml() { @@ -92,6 +93,7 @@ public function getSettingsHtml() * @throws LoaderError * @throws RuntimeError * @throws SyntaxError + * @throws \yii\base\Exception */ public function getInputHtml($value, ElementInterface $element = null): string { diff --git a/src/fields/Email.php b/src/fields/Email.php index dbc1dbe..238a520 100644 --- a/src/fields/Email.php +++ b/src/fields/Email.php @@ -16,6 +16,7 @@ use Twig\Error\LoaderError; use Twig\Error\RuntimeError; use Twig\Error\SyntaxError; +use yii\base\Exception; /** * @@ -59,6 +60,7 @@ public static function displayName(): string * @throws LoaderError * @throws RuntimeError * @throws SyntaxError + * @throws Exception */ public function getSettingsHtml() { @@ -73,6 +75,7 @@ public function getSettingsHtml() * @throws LoaderError * @throws RuntimeError * @throws SyntaxError + * @throws Exception */ public function getInputHtml($value, ElementInterface $element = null): string { diff --git a/src/fields/Gender.php b/src/fields/Gender.php index aa4e87e..4cd1256 100644 --- a/src/fields/Gender.php +++ b/src/fields/Gender.php @@ -13,6 +13,7 @@ use Twig\Error\LoaderError; use Twig\Error\RuntimeError; use Twig\Error\SyntaxError; +use yii\base\Exception; class Gender extends Field { @@ -51,8 +52,7 @@ public function defineContentAttribute(): bool * @throws LoaderError * @throws RuntimeError * @throws SyntaxError - * @throws \yii\base\Exception - * @throws \yii\base\Exception + * @throws Exception */ public function getInputHtml($value, ElementInterface $element = null): string { diff --git a/src/fields/Name.php b/src/fields/Name.php index 7d344e2..424cbfb 100644 --- a/src/fields/Name.php +++ b/src/fields/Name.php @@ -16,6 +16,7 @@ use Twig\Error\LoaderError; use Twig\Error\RuntimeError; use Twig\Error\SyntaxError; +use yii\base\Exception; /** * @@ -54,6 +55,7 @@ public static function displayName(): string * @throws LoaderError * @throws RuntimeError * @throws SyntaxError + * @throws Exception */ public function getSettingsHtml() { @@ -70,6 +72,7 @@ public function getSettingsHtml() * @throws LoaderError * @throws RuntimeError * @throws SyntaxError + * @throws Exception */ public function getInputHtml($value, ElementInterface $element = null): string { diff --git a/src/fields/Phone.php b/src/fields/Phone.php index dcd34d9..9e2aab3 100644 --- a/src/fields/Phone.php +++ b/src/fields/Phone.php @@ -17,6 +17,7 @@ use Twig\Error\LoaderError; use Twig\Error\RuntimeError; use Twig\Error\SyntaxError; +use yii\base\Exception; use yii\db\Schema; /** @@ -101,6 +102,7 @@ public function serializeValue($value, ElementInterface $element = null) * @throws LoaderError * @throws RuntimeError * @throws SyntaxError + * @throws Exception */ public function getSettingsHtml() { @@ -117,6 +119,7 @@ public function getSettingsHtml() * @throws LoaderError * @throws RuntimeError * @throws SyntaxError + * @throws Exception */ public function getInputHtml($value, ElementInterface $element = null): string { diff --git a/src/fields/Predefined.php b/src/fields/Predefined.php index d21e35c..6eeac5a 100644 --- a/src/fields/Predefined.php +++ b/src/fields/Predefined.php @@ -1,9 +1,4 @@ 'Name (Sprout Fields)', 'Email (Sprout Fields)' => 'Email (Sprout Fields)', 'Phone (Sprout Fields)' => 'Phone (Sprout Fields)', - 'Predefined Date (Sprout Fields)' => 'Predefined Date (Sprout Fields)' + 'Predefined Date (Sprout Fields)' => 'Predefined Date (Sprout Fields)', + 'Template (Sprout Fields)' => 'Template (Sprout Fields)' ];