Completed
Push — master ( b7290a...f2cd13 )
by Mihail
04:20
created
src/Ffcms/Core/Helper/FileSystem/Directory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             return false;
92 92
         }
93 93
 
94
-        $pattern = rtrim($path, '/') . '/*';
94
+        $pattern = rtrim($path, '/').'/*';
95 95
         $entry = glob($pattern, $mod);
96 96
 
97 97
         if ($returnRelative === true) {
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         array_pop($separatedPath);
123 123
         $clearPath = implode(DIRECTORY_SEPARATOR, $separatedPath);
124 124
 
125
-        @rename($path, $clearPath . DIRECTORY_SEPARATOR . $newDirName);
125
+        @rename($path, $clearPath.DIRECTORY_SEPARATOR.$newDirName);
126 126
 
127 127
         return true;
128 128
     }
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/FileSystem/File.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -165,15 +165,15 @@
 block discarded – undo
165 165
     {
166 166
         $path = Normalize::diskFullPath($path);
167 167
 
168
-        $dir = opendir($path . '/.');
168
+        $dir = opendir($path.'/.');
169 169
         while ($item = readdir($dir)) {
170
-            if (is_file($sub = $path . '/' . $item)) {
170
+            if (is_file($sub = $path.'/'.$item)) {
171 171
                 $item_ext = Str::lastIn($item, '.');
172 172
                 if ($ext === null || Arr::in($item_ext, $ext)) {
173 173
                     if ($returnRelative) {
174 174
                         $files[] = $item;
175 175
                     } else {
176
-                        $files[] = $path . DIRECTORY_SEPARATOR . $item;
176
+                        $files[] = $path.DIRECTORY_SEPARATOR.$item;
177 177
                     }
178 178
                 }
179 179
             } else {
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/HTML/Form/Constructor.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     {
45 45
         // check if properties is passed well
46 46
         if (!Obj::isArray($properties) && $properties !== null) {
47
-            throw new SyntaxException('Property must be passed as array or null! Field: ' . $name);
47
+            throw new SyntaxException('Property must be passed as array or null! Field: '.$name);
48 48
         }
49 49
         
50 50
         // add properties to autovalidation by js (properties passed by ref)
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
         
95 95
         // if field is unknown type add notification in debugbar
96 96
         if (App::$Debug !== null) {
97
-            App::$Debug->addMessage('Field with name [' . App::$Security->strip_tags($name) . '] have unknown type [' . $this->type . ']', 'error');
97
+            App::$Debug->addMessage('Field with name ['.App::$Security->strip_tags($name).'] have unknown type ['.$this->type.']', 'error');
98 98
         }
99
-        return 'No data: ' . App::$Security->strip_tags($name);
99
+        return 'No data: '.App::$Security->strip_tags($name);
100 100
     }
101 101
     
102 102
     /**
@@ -143,12 +143,12 @@  discard block
 block discarded – undo
143 143
         if (Str::contains('.', $name)) {
144 144
             $splitedName = explode('.', $name);
145 145
             foreach ($splitedName as $nameKey) {
146
-                $properties['name'] .= '[' . $nameKey . ']';
147
-                $properties['id'] .= '-' . $nameKey;
146
+                $properties['name'] .= '['.$nameKey.']';
147
+                $properties['id'] .= '-'.$nameKey;
148 148
             }
149 149
         } else { // standard property definition - add field name
150
-            $properties['name'] .= '[' . $name . ']';
151
-            $properties['id'] .= '-' . $name;
150
+            $properties['name'] .= '['.$name.']';
151
+            $properties['id'] .= '-'.$name;
152 152
         }
153 153
     }
154 154
 }
155 155
\ No newline at end of file
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/HTML/Form/MultiSelectField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
         if (isset($this->properties['options']) && Obj::isArray($this->properties['options'])) {
39 39
             $options = $this->properties['options'];
40 40
         } else {
41
-            throw new SyntaxException('Options for field ' . self::nohtml($this->name) . ' is not defined');
41
+            throw new SyntaxException('Options for field '.self::nohtml($this->name).' is not defined');
42 42
         }
43 43
         
44 44
         // set global field type
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/HTML/Form/SelectField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
         $options = $this->properties['options'];
36 36
         unset($this->properties['options']);
37 37
         if (!Obj::isArray($options) || count($options) < 1) {
38
-            throw new SyntaxException('Select field ' . self::nohtml($this->name) . ' have no options passed');
38
+            throw new SyntaxException('Select field '.self::nohtml($this->name).' have no options passed');
39 39
         }
40 40
         // value is not used there
41 41
         unset($this->properties['value']);
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/HTML/Form/CaptchaField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
             'id' => 'src-secure-image',
41 41
             'src' => $image,
42 42
             'alt' => 'secure captcha image',
43
-            'onClick' => 'this.src=\'' . $image . '&rnd=\'+Math.random()'
43
+            'onClick' => 'this.src=\''.$image.'&rnd=\'+Math.random()'
44 44
         ]);
45 45
         // render response tag with image
46 46
         $this->properties['type'] = 'text';
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/HTML/System/Dom.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
     {
98 98
         // looks like a single tag, <img src="" class="" />, <hr class="" />
99 99
         if (Arr::in($name, self::$singleTags)) {
100
-            return '<' . $name . self::applyProperties($properties) . ' />';
101
-        } elseif(Arr::in($name, self::$containerTags)) { // looks like a container tag, <div class=""></div>
102
-            return '<' . $name . self::applyProperties($properties) . '>' . $content . '</' . $name . '>';
100
+            return '<'.$name.self::applyProperties($properties).' />';
101
+        } elseif (Arr::in($name, self::$containerTags)) { // looks like a container tag, <div class=""></div>
102
+            return '<'.$name.self::applyProperties($properties).'>'.$content.'</'.$name.'>';
103 103
         }
104 104
 
105 105
         // empty response
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
             }
127 127
             // sounds like single standalone property, ex required, selected etc
128 128
             if ($value === null || $value === false) {
129
-                $build .= ' ' . htmlentities($property, ENT_QUOTES);
129
+                $build .= ' '.htmlentities($property, ENT_QUOTES);
130 130
             } else { // sounds like a classic key="value" property
131
-                $build .= ' ' . htmlentities($property, ENT_QUOTES) . '="' . htmlentities($value, ENT_QUOTES) . '"';
131
+                $build .= ' '.htmlentities($property, ENT_QUOTES).'="'.htmlentities($value, ENT_QUOTES).'"';
132 132
             }
133 133
         }
134 134
         return $build;
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/HTML/Form.php 3 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      */
75 75
     public function start()
76 76
     {
77
-        return '<form' . self::applyProperty($this->formProperty) . '>';
77
+        return '<form'.self::applyProperty($this->formProperty).'>';
78 78
     }
79 79
 
80 80
     /**
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     {
91 91
         if ($this->model === null) {
92 92
             if (App::$Debug !== null) {
93
-                App::$Debug->addMessage('Form model is not defined for field name: [' . strip_tags($object) . ']');
93
+                App::$Debug->addMessage('Form model is not defined for field name: ['.strip_tags($object).']');
94 94
             }
95 95
             return null;
96 96
         }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         // check if model contains current tag name as property
105 105
         if (!property_exists($this->model, $propertyName)) {
106 106
             if (App::$Debug !== null) {
107
-                App::$Debug->addMessage('Form field ["' . $object . '"] is not defined in model: [' . get_class($this->model) . ']', 'error');
107
+                App::$Debug->addMessage('Form field ["'.$object.'"] is not defined in model: ['.get_class($this->model).']', 'error');
108 108
             }
109 109
             return null;
110 110
         }
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
         }
120 120
         
121 121
         // prepare labels text and label "for" attr 
122
-        $labelFor = $this->name . '-' . $propertyName;
122
+        $labelFor = $this->name.'-'.$propertyName;
123 123
         $labelText = $this->model->getLabel($object);
124 124
         $itemValue = $this->model->{$propertyName};
125 125
         // sounds like a dot-separated $object
126 126
         if ($propertyName !== $object) {
127 127
             $nesting = trim(strstr($object, '.'), '.');
128
-            $labelFor .= '-' . Str::replace('.', '-', $nesting);
128
+            $labelFor .= '-'.Str::replace('.', '-', $nesting);
129 129
             $itemValue = Arr::getByPath($nesting, $itemValue);
130 130
         }
131 131
         //$itemBody = $this->dataTypeTag($type, $object, $itemValue, $property);
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     public function submitButton($title, array $property = [])
156 156
     {
157 157
         $property['type'] = 'submit';
158
-        $property['name'] = $this->name . '[submit]';
158
+        $property['name'] = $this->name.'[submit]';
159 159
         $property['value'] = $title;
160 160
         return self::buildSingleTag('input', $property);
161 161
     }
@@ -169,10 +169,10 @@  discard block
 block discarded – undo
169 169
     {
170 170
         // pre-validate form fields based on model rules and jquery.validation
171 171
         if ($validate) {
172
-            App::$Alias->addPlainCode('js', '$().ready(function() { $("#' . $this->name . '").validate(); });');
172
+            App::$Alias->addPlainCode('js', '$().ready(function() { $("#'.$this->name.'").validate(); });');
173 173
             App::$Alias->setCustomLibrary('js', '/vendor/bower/jquery-validation/dist/jquery.validate.min.js');
174 174
             if (App::$Request->getLanguage() !== 'en') {
175
-                $localeFile = '/vendor/bower/jquery-validation/src/localization/messages_' . App::$Request->getLanguage() . '.js';
175
+                $localeFile = '/vendor/bower/jquery-validation/src/localization/messages_'.App::$Request->getLanguage().'.js';
176 176
                 if (File::exist($localeFile)) {
177 177
                     App::$Alias->setCustomLibrary('js', $localeFile);
178 178
                 }
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
                 $formName = $this->model->getFormName();
184 184
                 if (Obj::isArray($badAttr) && count($badAttr) > 0) {
185 185
                     foreach ($badAttr as $attr) {
186
-                        $itemId = $formName . '-' . $attr;
186
+                        $itemId = $formName.'-'.$attr;
187 187
                         $render = App::$View->render($this->structLayer['jsnotify'], ['itemId' => $itemId]);
188 188
                         App::$Alias->addPlainCode('js', $render);
189 189
                     }
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -103,8 +103,8 @@
 block discarded – undo
103 103
 
104 104
     /**
105 105
      * Display form field. Allowed type: text, password, textarea, checkbox, select, checkboxes, file, captcha, email, hidden
106
-     * @param $object
107
-     * @param $type
106
+     * @param string $object
107
+     * @param string $type
108 108
      * @param null|array $property
109 109
      * @param null|string $helper
110 110
      * @param null|string $layerFile
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
 use Ffcms\Core\Exception\NativeException;
7 7
 use Ffcms\Core\Exception\SyntaxException;
8 8
 use Ffcms\Core\Helper\HTML\System\NativeGenerator;
9
-use Ffcms\Core\Helper\Security;
10 9
 use Ffcms\Core\Helper\Type\Arr;
11 10
 use Ffcms\Core\Helper\FileSystem\File;
12 11
 use Ffcms\Core\Helper\Type\Obj;
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/Type/Arr.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -118,16 +118,16 @@
 block discarded – undo
118 118
                         return 'true';
119 119
                     }
120 120
                 }
121
-                return '\'' . $var . '\'';
121
+                return '\''.$var.'\'';
122 122
             case 'array':
123 123
                 $indexed = array_keys($var) === range(0, count($var) - 1);
124 124
                 $row = [];
125 125
                 foreach ($var as $key => $value) {
126
-                    $row[] = $indent . "\t"
127
-                        . ($indexed ? null : self::exportVar($key, null, $guessTypes) . ' => ')
128
-                        . self::exportVar($value, $indent . "\t", $guessTypes);
126
+                    $row[] = $indent."\t"
127
+                        . ($indexed ? null : self::exportVar($key, null, $guessTypes).' => ')
128
+                        . self::exportVar($value, $indent."\t", $guessTypes);
129 129
                 }
130
-                return "[\n" . implode(",\n", $row) . "\n" . $indent . ']';
130
+                return "[\n".implode(",\n", $row)."\n".$indent.']';
131 131
             case 'boolean':
132 132
                 return $var ? 'true' : 'false';
133 133
             default:
Please login to merge, or discard this patch.