@@ -47,8 +47,8 @@ |
||
47 | 47 | { |
48 | 48 | if (Schema::hasTable('system_settings')) { |
49 | 49 | $settings = [ |
50 | - Settings::FONTAWESOME_LINK_KEY => Settings::FONTAWESOME_LINK, |
|
51 | - Settings::FONTAWESOME_LINK_ATTRIBUTES_KEY => Settings::FONTAWESOME_LINK_ATTRIBUTES |
|
50 | + Settings::FONTAWESOME_LINK_KEY => Settings::FONTAWESOME_LINK, |
|
51 | + Settings::FONTAWESOME_LINK_ATTRIBUTES_KEY => Settings::FONTAWESOME_LINK_ATTRIBUTES |
|
52 | 52 | ]; |
53 | 53 | |
54 | 54 | DB::table('system_settings')->insert( |
@@ -52,7 +52,7 @@ |
||
52 | 52 | ]; |
53 | 53 | |
54 | 54 | DB::table('system_settings')->insert( |
55 | - ['item' => Settings::SETTINGS_CODE, 'value' => json_encode($settings)] |
|
55 | + [ 'item' => Settings::SETTINGS_CODE, 'value' => json_encode($settings) ] |
|
56 | 56 | ); |
57 | 57 | } |
58 | 58 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | const SETTINGS_CODE = 'ginopane_awesomeiconslist'; |
32 | 32 | |
33 | - public $implement = [SettingsModel::class]; |
|
33 | + public $implement = [ SettingsModel::class ]; |
|
34 | 34 | |
35 | 35 | public $settingsCode = self::SETTINGS_CODE; |
36 | 36 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | public function fontAwesomeLink() : string |
43 | 43 | { |
44 | 44 | $link = !empty($this->{self::FONTAWESOME_LINK_KEY}) |
45 | - ? (string) $this->{self::FONTAWESOME_LINK_KEY} |
|
45 | + ? (string)$this->{self::FONTAWESOME_LINK_KEY} |
|
46 | 46 | : self::FONTAWESOME_LINK; |
47 | 47 | |
48 | 48 | return $link; |
@@ -54,13 +54,13 @@ discard block |
||
54 | 54 | public function fontAwesomeLinkAttributes(): array |
55 | 55 | { |
56 | 56 | $rawAttributes = !empty($this->{self::FONTAWESOME_LINK_ATTRIBUTES_KEY}) |
57 | - ? (array) $this->{self::FONTAWESOME_LINK_ATTRIBUTES_KEY} |
|
57 | + ? (array)$this->{self::FONTAWESOME_LINK_ATTRIBUTES_KEY} |
|
58 | 58 | : self::FONTAWESOME_LINK_ATTRIBUTES; |
59 | 59 | |
60 | - $attributes = []; |
|
60 | + $attributes = [ ]; |
|
61 | 61 | |
62 | 62 | foreach ($rawAttributes as $attribute) { |
63 | - $attributes[$attribute['attribute']] = $attribute['value']; |
|
63 | + $attributes[ $attribute[ 'attribute' ] ] = $attribute[ 'value' ]; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | return $attributes; |
@@ -2,10 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace GinoPane\AwesomeIconsList\Updates; |
4 | 4 | |
5 | -use DB; |
|
6 | -use Schema; |
|
7 | -use October\Rain\Database\Updates\Migration; |
|
8 | - |
|
9 | 5 | /** |
10 | 6 | * Class UpdateSettingsTo570 |
11 | 7 | * |
@@ -2,10 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace GinoPane\AwesomeIconsList\Updates; |
4 | 4 | |
5 | -use DB; |
|
6 | -use Schema; |
|
7 | -use October\Rain\Database\Updates\Migration; |
|
8 | - |
|
9 | 5 | /** |
10 | 6 | * Class UpdateSettingsTo572 |
11 | 7 | * |
@@ -15,10 +15,10 @@ discard block |
||
15 | 15 | abstract class UpdateSettingsAbstract extends Migration |
16 | 16 | { |
17 | 17 | protected static $PREVIOUS_FONTAWESOME_LINK = ''; |
18 | - protected static $PREVIOUS_FONTAWESOME_LINK_ATTRIBUTES = []; |
|
18 | + protected static $PREVIOUS_FONTAWESOME_LINK_ATTRIBUTES = [ ]; |
|
19 | 19 | |
20 | 20 | protected static $NEW_FONTAWESOME_LINK = ''; |
21 | - protected static $NEW_FONTAWESOME_LINK_ATTRIBUTES = []; |
|
21 | + protected static $NEW_FONTAWESOME_LINK_ATTRIBUTES = [ ]; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Execute migrations |
@@ -45,18 +45,18 @@ discard block |
||
45 | 45 | if (Schema::hasTable('system_settings')) { |
46 | 46 | $currentSettings = DB::table('system_settings')->whereItem(Settings::SETTINGS_CODE)->pluck('value')->first(); |
47 | 47 | |
48 | - $settings = []; |
|
48 | + $settings = [ ]; |
|
49 | 49 | |
50 | - $settings[Settings::FONTAWESOME_LINK_KEY ] = $link; |
|
51 | - $settings[Settings::FONTAWESOME_LINK_ATTRIBUTES_KEY] = $attributes; |
|
50 | + $settings[ Settings::FONTAWESOME_LINK_KEY ] = $link; |
|
51 | + $settings[ Settings::FONTAWESOME_LINK_ATTRIBUTES_KEY ] = $attributes; |
|
52 | 52 | |
53 | 53 | if ($currentSettings !== null) { |
54 | 54 | DB::table('system_settings')->whereItem(Settings::SETTINGS_CODE)->update( |
55 | - ['value' => json_encode($settings)] |
|
55 | + [ 'value' => json_encode($settings) ] |
|
56 | 56 | ); |
57 | 57 | } else { |
58 | 58 | DB::table('system_settings')->insert( |
59 | - ['item' => Settings::SETTINGS_CODE, 'value' => json_encode($settings)] |
|
59 | + [ 'item' => Settings::SETTINGS_CODE, 'value' => json_encode($settings) ] |
|
60 | 60 | ); |
61 | 61 | } |
62 | 62 | } |
@@ -75,13 +75,13 @@ |
||
75 | 75 | */ |
76 | 76 | public function prepareVars() |
77 | 77 | { |
78 | - $this->vars['field'] = $this->formField; |
|
79 | - $this->vars['unicodeValue'] = $this->unicodeValue; |
|
80 | - $this->vars['placeholder'] = $this->placeholder; |
|
81 | - $this->vars['emptyOption'] = $this->emptyOption; |
|
82 | - $this->vars['iconTypes'] = $this->parseIconTypes((string) $this->iconTypes); |
|
78 | + $this->vars[ 'field' ] = $this->formField; |
|
79 | + $this->vars[ 'unicodeValue' ] = $this->unicodeValue; |
|
80 | + $this->vars[ 'placeholder' ] = $this->placeholder; |
|
81 | + $this->vars[ 'emptyOption' ] = $this->emptyOption; |
|
82 | + $this->vars[ 'iconTypes' ] = $this->parseIconTypes((string)$this->iconTypes); |
|
83 | 83 | |
84 | - $this->vars['value'] = $this->getLoadValue(); |
|
84 | + $this->vars[ 'value' ] = $this->getLoadValue(); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |