Completed
Push — master ( 9c1cd5...e7beb0 )
by Tõnis
03:00
created
src/Settings.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -95,15 +95,15 @@  discard block
 block discarded – undo
95 95
 
96 96
 
97 97
     /** {@inheritdoc} */
98
-    public function setSettings(){
98
+    public function setSettings() {
99 99
         // get existing settings
100 100
 
101 101
         /** @var Setting $settingClass */
102 102
         $settingClass = $this->itemClass;
103 103
         $query = $settingClass::find();
104 104
         $settings = $query->all();
105
-        if(!empty($settings)){
106
-            foreach ($settings as $setting){
105
+        if (!empty($settings)) {
106
+            foreach ($settings as $setting) {
107 107
                 if (in_array($setting->key, array_keys($this->attributes))) {
108 108
                     $this->settings[$setting->key] = $setting;
109 109
                     $this->{$setting->key} = $setting->value;
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
     }
127 127
 
128 128
     /** {@inheritdoc} */
129
-    public function save(){
130
-        if(!empty($this->settings)){
131
-            foreach ($this->settings as $key=> $setting){
129
+    public function save() {
130
+        if (!empty($this->settings)) {
131
+            foreach ($this->settings as $key=> $setting) {
132 132
                 if (in_array($setting->key, array_keys($this->attributes))) {
133 133
                     $setting->save();
134 134
                     $this->settings[$key] = $setting;
Please login to merge, or discard this patch.
src/Setting.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
      * @param $key string
46 46
      * @return static
47 47
      */
48
-    public function findOneByKey($key){
48
+    public function findOneByKey($key) {
49 49
         $model = static::find()
50 50
             ->andWhere([$this->keyColumn => $key])
51 51
             ->one();
Please login to merge, or discard this patch.