Skip to content

Commit 951849b

Browse files
committed
Fix CS errors
Signed-off-by: Jan Henckens <jan@henckens.be>
1 parent 3006ed5 commit 951849b

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

src/assetbundles/configvalues/ConfigValuesAsset.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ public function init()
1111
$this->sourcePath = "@statikbe/configvaluesfield/assetbundles/configvalues/dist";
1212

1313
$this->css = [
14-
'css/configvalues.css'
14+
'css/configvalues.css',
1515
];
1616
parent::init();
1717
}
18-
}
18+
}

src/fields/ConfigValuesFieldField.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111

1212
namespace statikbe\configvaluesfield\fields;
1313

14-
use craft\helpers\App;
15-
use statikbe\configvaluesfield\assetbundles\configvalues\ConfigValuesAsset;
16-
use statikbe\configvaluesfield\ConfigValuesField;
1714
use Craft;
1815
use craft\base\ElementInterface;
16+
use craft\base\Field;
1917
use craft\base\InlineEditableFieldInterface;
2018
use craft\base\SortableFieldInterface;
21-
use craft\base\Field;
19+
use craft\helpers\App;
20+
use statikbe\configvaluesfield\assetbundles\configvalues\ConfigValuesAsset;
21+
use statikbe\configvaluesfield\ConfigValuesField;
2222

2323
/**
2424
* @author Statik.be
@@ -32,11 +32,11 @@ class ConfigValuesFieldField extends Field implements InlineEditableFieldInterfa
3232
public string $dataSet = '';
3333
public string $type = 'dropdown';
3434

35-
const TYPE_DROPDOWN = 'dropdown';
36-
const TYPE_RADIO = 'radios';
37-
const TYPE_CHECKBOX = 'checkboxes';
38-
const TYPE_COLOR = 'color';
39-
const TYPE_SHAPE = 'shape';
35+
public const TYPE_DROPDOWN = 'dropdown';
36+
public const TYPE_RADIO = 'radios';
37+
public const TYPE_CHECKBOX = 'checkboxes';
38+
public const TYPE_COLOR = 'color';
39+
public const TYPE_SHAPE = 'shape';
4040

4141
// Static Methods
4242
// =========================================================================
@@ -71,7 +71,7 @@ public function defineRules(): array
7171
['dataSet', 'required'],
7272
['type', 'string'],
7373
['type', 'required'],
74-
['type', 'dataShouldMatchType']
74+
['type', 'dataShouldMatchType'],
7575
]);
7676
return $rules;
7777
}
@@ -100,7 +100,7 @@ public function dataShouldMatchType($attribute, $params): void
100100
}
101101
}
102102
} else {
103-
if(!in_array($option, ['random', 'none'])) {
103+
if (!in_array($option, ['random', 'none'])) {
104104
$this->addError("$attribute", "Each option should either contain a hex value, 'random' or 'none' when type is 'color'");
105105
return;
106106
}
@@ -109,26 +109,26 @@ public function dataShouldMatchType($attribute, $params): void
109109
break;
110110

111111
case self::TYPE_SHAPE:
112-
if(!isset($data['path'])) {
112+
if (!isset($data['path'])) {
113113
$this->addError("$attribute", "A valid path must be configured when type is 'shape'");
114114
}
115115

116-
if(isset($data['path'])) {
116+
if (isset($data['path'])) {
117117
$path = App::parseEnv($data['path']);
118-
if(!is_dir($path)) {
118+
if (!is_dir($path)) {
119119
$this->addError("$attribute", "The path to the shapes must be a valid directory");
120120
}
121121
}
122122

123-
if(!isset($data['shapes'])) {
123+
if (!isset($data['shapes'])) {
124124
$this->addError("$attribute", "A set of 'shapes' must be configured when type is 'shape'");
125125
}
126126

127-
if(isset($data['shapes']) && isset($data['path'])) {
127+
if (isset($data['shapes']) && isset($data['path'])) {
128128
$path = App::parseEnv($data['path']);
129-
foreach($data['shapes'] as $filename => $value) {
129+
foreach ($data['shapes'] as $filename => $value) {
130130
$filepath = $path . $filename . '.svg';
131-
if(!file_exists($filepath)) {
131+
if (!file_exists($filepath)) {
132132
$this->addError("$attribute", "The file $filename.svg does not exist in the configured path");
133133
}
134134
}

src/models/Settings.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ class Settings extends Model
1717
public array $data = [];
1818

1919
public string $type = "";
20-
2120
}

0 commit comments

Comments
 (0)