Skip to content

Commit

Permalink
Remove score types
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed May 30, 2024
1 parent 2b9465a commit 3250ad8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 35 deletions.
2 changes: 1 addition & 1 deletion phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ parameters:

-
message: "#^Call to an undefined static method Igniter\\\\Local\\\\Models\\\\ReviewSettings\\:\\:get\\(\\)\\.$#"
count: 4
count: 3
path: src/Models/ReviewSettings.php

-
Expand Down
23 changes: 0 additions & 23 deletions resources/models/reviewsettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,6 @@
'condition' => 'checked',
],
],
'score_types' => [
'label' => 'lang:igniter.local::default.reviews.label_score_types',
'tab' => 'lang:igniter.local::default.reviews.text_tab_title_reviews',
'type' => 'repeater',
'sortable' => true,
'showAddButton' => false,
'showRemoveButton' => false,
'default' => ReviewSettings::$defaultScoreTypes,
'form' => [
'fields' => [
'value' => [
'type' => 'text',
],
'code' => [
'type' => 'text',
'attributes' => [
'readonly' => true,
],
],
],
],
'commentAbove' => 'lang:igniter.local::default.reviews.help_score_types',
],
'hints' => [
'label' => 'lang:igniter.local::default.reviews.label_hints',
'tab' => 'lang:igniter.local::default.reviews.text_tab_title_reviews',
Expand Down
11 changes: 0 additions & 11 deletions src/Models/ReviewSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ class ReviewSettings extends Model
['value' => 'Excellent'],
];

public static array $defaultScoreTypes = [
['code' => 'delivery', 'value' => 'Delivery'],
['code' => 'quality', 'value' => 'Quality'],
['code' => 'service', 'value' => 'Service'],
];

public static function allowReviews()
{
return (bool)self::get('allow_reviews', true);
Expand All @@ -38,11 +32,6 @@ public static function autoApproveReviews()
return self::get('approve_reviews', false);
}

public static function getScoreTypes()
{
return collect(self::get('score_types', self::$defaultScoreTypes))->pluck('value', 'code')->all();
}

public static function getHints()
{
return collect(self::get('hints', self::$defaultHints))->pluck('value')->all();
Expand Down

0 comments on commit 3250ad8

Please sign in to comment.