Completed
Push — master ( 276832...8757d5 )
by Mihail
03:32
created
src/Ffcms/Core/Properties.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
         }
47 47
 
48 48
         // try to load from file
49
-        $configFile = ucfirst(Str::lowerCase($configName)) . '.php';
50
-        if (File::exist('/Private/Config/' . $configFile)) {
51
-            $this->data[$configName] = File::inc('/Private/Config/' . $configFile, true);
49
+        $configFile = ucfirst(Str::lowerCase($configName)).'.php';
50
+        if (File::exist('/Private/Config/'.$configFile)) {
51
+            $this->data[$configName] = File::inc('/Private/Config/'.$configFile, true);
52 52
             return true;
53 53
         }
54 54
 
@@ -139,11 +139,11 @@  discard block
 block discarded – undo
139 139
      */
140 140
     public function writeConfig($configFile, array $data)
141 141
     {
142
-        $path = '/Private/Config/' . ucfirst(Str::lowerCase($configFile)) . '.php';
142
+        $path = '/Private/Config/'.ucfirst(Str::lowerCase($configFile)).'.php';
143 143
         if (!File::exist($path) || !File::writable($path)) {
144 144
             return false;
145 145
         }
146
-        $saveData = '<?php return ' . Arr::exportVar($data) . ';';
146
+        $saveData = '<?php return '.Arr::exportVar($data).';';
147 147
         File::write($path, $saveData);
148 148
         return true;
149 149
     }
Please login to merge, or discard this patch.
src/Ffcms/Core/Managers/CronManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             return false;
77 77
         }
78 78
 
79
-        $callback = (string)$class . '::' . (string)$method;
79
+        $callback = (string)$class.'::'.(string)$method;
80 80
 
81 81
         // add instance to cron task manager
82 82
         if (!isset($this->configs['instances'][$callback])) {
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      */
95 95
     public function remove($class, $method)
96 96
     {
97
-        $callback = $class . '::' . $method;
97
+        $callback = $class.'::'.$method;
98 98
         if (isset($this->configs['instances'][$callback])) {
99 99
             unset($this->configs['instances'][$callback], $this->configs['log'][$callback]);
100 100
             App::$Properties->writeConfig('Cron', $this->configs);
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/HTML/Form.php 3 patches
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.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     {
82 82
         $form = self::buildSingleTag('form', $this->formProperty, false);
83 83
         if ($this->model->_tokenRequired) {
84
-            $form .= PHP_EOL . $this->field('_csrf_token', 'hidden', ['value' => $this->model->_csrf_token]);
84
+            $form .= PHP_EOL.$this->field('_csrf_token', 'hidden', ['value' => $this->model->_csrf_token]);
85 85
         }
86 86
         return $form;
87 87
     }
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     {
102 102
         if ($this->model === null) {
103 103
             if (App::$Debug !== null) {
104
-                App::$Debug->addMessage('Form model is not defined for field name: [' . strip_tags($object) . ']');
104
+                App::$Debug->addMessage('Form model is not defined for field name: ['.strip_tags($object).']');
105 105
             }
106 106
             return null;
107 107
         }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         // check if model contains current tag name as property
116 116
         if (!property_exists($this->model, $propertyName)) {
117 117
             if (App::$Debug !== null) {
118
-                App::$Debug->addMessage('Form field ["' . $object . '"] is not defined in model: [' . get_class($this->model) . ']', 'error');
118
+                App::$Debug->addMessage('Form field ["'.$object.'"] is not defined in model: ['.get_class($this->model).']', 'error');
119 119
             }
120 120
             return null;
121 121
         }
@@ -136,13 +136,13 @@  discard block
 block discarded – undo
136 136
         }
137 137
         
138 138
         // prepare labels text and label "for" attr 
139
-        $labelFor = $this->name . '-' . $propertyName;
139
+        $labelFor = $this->name.'-'.$propertyName;
140 140
         $labelText = $this->model->getLabel($object);
141 141
         $itemValue = $this->model->{$propertyName};
142 142
         // sounds like a dot-separated $object
143 143
         if ($propertyName !== $object) {
144 144
             $nesting = trim(strstr($object, '.'), '.');
145
-            $labelFor .= '-' . Str::replace('.', '-', $nesting);
145
+            $labelFor .= '-'.Str::replace('.', '-', $nesting);
146 146
             $itemValue = Arr::getByPath($nesting, $itemValue);
147 147
         }
148 148
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
     public function submitButton($title, array $property = [])
174 174
     {
175 175
         $property['type'] = 'submit';
176
-        $property['name'] = $this->name . '[submit]';
176
+        $property['name'] = $this->name.'[submit]';
177 177
         $property['value'] = $title;
178 178
         return self::buildSingleTag('input', $property);
179 179
     }
@@ -187,10 +187,10 @@  discard block
 block discarded – undo
187 187
     {
188 188
         // pre-validate form fields based on model rules and jquery.validation
189 189
         if ($validate) {
190
-            App::$Alias->addPlainCode('js', '$().ready(function() { $("#' . $this->name . '").validate(); });');
190
+            App::$Alias->addPlainCode('js', '$().ready(function() { $("#'.$this->name.'").validate(); });');
191 191
             App::$Alias->setCustomLibrary('js', '/vendor/bower/jquery-validation/dist/jquery.validate.min.js');
192 192
             if (App::$Request->getLanguage() !== 'en') {
193
-                $localeFile = '/vendor/bower/jquery-validation/src/localization/messages_' . App::$Request->getLanguage() . '.js';
193
+                $localeFile = '/vendor/bower/jquery-validation/src/localization/messages_'.App::$Request->getLanguage().'.js';
194 194
                 if (File::exist($localeFile)) {
195 195
                     App::$Alias->setCustomLibrary('js', $localeFile);
196 196
                 }
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
                 $formName = $this->model->getFormName();
202 202
                 if (Obj::isArray($badAttr) && count($badAttr) > 0) {
203 203
                     foreach ($badAttr as $attr) {
204
-                        $itemId = $formName . '-' . $attr;
204
+                        $itemId = $formName.'-'.$attr;
205 205
                         $render = App::$View->render(static::$structLayer['jsnotify'], ['itemId' => $itemId]);
206 206
                         App::$Alias->addPlainCode('js', $render);
207 207
                     }
Please login to merge, or discard this patch.
src/Ffcms/Core/Helper/HTML/Form/RadioField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
         $options = $this->properties['options'];
43 43
         unset($this->properties['options']);
44 44
         if (!Obj::isArray($options) || count($options) < 1) {
45
-            throw new SyntaxException('Radio field ' . self::nohtml($this->name) . ' have no options passed');
45
+            throw new SyntaxException('Radio field '.self::nohtml($this->name).' have no options passed');
46 46
         }
47 47
 
48 48
         // value is not used there
Please login to merge, or discard this patch.
src/Ffcms/Core/Managers/BootManager.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
         // check if cache is enabled
40 40
         if (App::$Cache !== null) {
41 41
             // try to get bootable class map from cache, or initialize parsing
42
-            if (App::$Cache->get('boot.' . env_name . '.class.map') !== null) {
43
-                $this->objects = App::$Cache->get('boot.' . env_name . '.class.map');
42
+            if (App::$Cache->get('boot.'.env_name.'.class.map') !== null) {
43
+                $this->objects = App::$Cache->get('boot.'.env_name.'.class.map');
44 44
             } else {
45 45
                 $this->compileBootableClasses();
46
-                App::$Cache->set('boot.' . env_name . '.class.map', $this->objects, static::CACHE_TREE_TIME);
46
+                App::$Cache->set('boot.'.env_name.'.class.map', $this->objects, static::CACHE_TREE_TIME);
47 47
             }
48 48
         }
49 49
     }
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
     {
90 90
         // list app root's
91 91
         foreach ($this->appRoots as $app) {
92
-            $app .= '/Apps/Controller/' . env_name;
92
+            $app .= '/Apps/Controller/'.env_name;
93 93
             $files = File::listFiles($app, ['.php'], true);
94 94
             foreach ($files as $file) {
95 95
                 // define full class name with namespace
96
-                $class = 'Apps\Controller\\' . env_name . '\\' . Str::cleanExtension($file);
96
+                $class = 'Apps\Controller\\'.env_name.'\\'.Str::cleanExtension($file);
97 97
                 // check if class exists (must be loaded over autoloader), boot method exist and this is controller instanceof
98 98
                 if (class_exists($class) && method_exists($class, 'boot') && is_a($class, 'Ffcms\Core\Arch\Controller', true)) {
99 99
                     $this->objects[] = $class;
@@ -103,14 +103,14 @@  discard block
 block discarded – undo
103 103
 
104 104
         // list widget root's
105 105
         foreach ($this->widgetRoots as $widget) {
106
-            $widget .= '/Widgets/' . env_name;
106
+            $widget .= '/Widgets/'.env_name;
107 107
             // widgets are packed in directory, classname should be the same with root directory name
108 108
             $dirs = Directory::scan($widget, GLOB_ONLYDIR, true);
109 109
             if (!Obj::isArray($dirs)) {
110 110
                 continue;
111 111
             }
112 112
             foreach ($dirs as $instance) {
113
-                $class = 'Widgets\\' . env_name . '\\' . $instance . '\\' . $instance;
113
+                $class = 'Widgets\\'.env_name.'\\'.$instance.'\\'.$instance;
114 114
                 if (class_exists($class) && method_exists($class, 'boot') && is_a($class, 'Ffcms\Core\Arch\Widget', true)) {
115 115
                     $this->objects[] = $class;
116 116
                 }
Please login to merge, or discard this patch.
src/Ffcms/Core/Traits/ClassTools.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
     {
18 18
         $hash = null;
19 19
         foreach ($this as $property => $value) {
20
-            $hash = md5($hash . $property . '=' . $value);
20
+            $hash = md5($hash.$property.'='.$value);
21 21
         }
22 22
         return $hash;
23 23
     }
Please login to merge, or discard this patch.
src/Ffcms/Core/Alias.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             $this->baseDomain = App::$Properties->get('baseDomain');
93 93
         }
94 94
         // build script url
95
-        $this->scriptUrl = App::$Request->getScheme() . '://' . $this->baseDomain;
95
+        $this->scriptUrl = App::$Request->getScheme().'://'.$this->baseDomain;
96 96
         if (App::$Properties->get('basePath') !== '/') {
97 97
             $this->scriptUrl .= rtrim(App::$Properties->get('basePath'), '/');
98 98
         }
@@ -104,22 +104,22 @@  discard block
 block discarded – undo
104 104
 
105 105
         $this->baseUrlNoLang = $this->baseUrl;
106 106
         if (App::$Request->languageInPath() && App::$Request->getLanguage() !== null) {
107
-            $this->baseUrl .= '/' . App::$Request->getLanguage();
107
+            $this->baseUrl .= '/'.App::$Request->getLanguage();
108 108
         }
109 109
 
110 110
         // build vendor libs alias
111
-        $this->vendorNamedLibrary['js']['jquery'] = $this->scriptUrl . '/vendor/bower/jquery/dist/jquery.min.js';
112
-        $this->vendorNamedLibrary['css']['bootstrap'] = $this->scriptUrl . '/vendor/bower/bootstrap/dist/css/bootstrap.min.css';
113
-        $this->vendorNamedLibrary['js']['bootstrap'] = $this->scriptUrl . '/vendor/bower/bootstrap/dist/js/bootstrap.min.js';
114
-        $this->vendorNamedLibrary['css']['fa'] = $this->scriptUrl . '/vendor/bower/components-font-awesome/css/font-awesome.min.css';
115
-        $this->vendorNamedLibrary['js']['jquery-ui'] = $this->scriptUrl . '/vendor/bower/jquery-ui/jquery-ui.min.js';
116
-        $this->vendorNamedLibrary['css']['jquery-ui'] = $this->scriptUrl . '/vendor/bower/jquery-ui/themes/base/jquery-ui.min.css';
111
+        $this->vendorNamedLibrary['js']['jquery'] = $this->scriptUrl.'/vendor/bower/jquery/dist/jquery.min.js';
112
+        $this->vendorNamedLibrary['css']['bootstrap'] = $this->scriptUrl.'/vendor/bower/bootstrap/dist/css/bootstrap.min.css';
113
+        $this->vendorNamedLibrary['js']['bootstrap'] = $this->scriptUrl.'/vendor/bower/bootstrap/dist/js/bootstrap.min.js';
114
+        $this->vendorNamedLibrary['css']['fa'] = $this->scriptUrl.'/vendor/bower/components-font-awesome/css/font-awesome.min.css';
115
+        $this->vendorNamedLibrary['js']['jquery-ui'] = $this->scriptUrl.'/vendor/bower/jquery-ui/jquery-ui.min.js';
116
+        $this->vendorNamedLibrary['css']['jquery-ui'] = $this->scriptUrl.'/vendor/bower/jquery-ui/themes/base/jquery-ui.min.css';
117 117
 
118 118
         $themeAll = App::$Properties->get('theme');
119 119
         if (!isset($themeAll[env_name]) || Str::length($themeAll[env_name]) < 1) {
120 120
             $themeAll[env_name] = 'default';
121 121
         }
122
-        $this->currentViewUrl = $this->scriptUrl . '/Apps/View/' . env_name . '/' . $themeAll[env_name];
122
+        $this->currentViewUrl = $this->scriptUrl.'/Apps/View/'.env_name.'/'.$themeAll[env_name];
123 123
     }
124 124
 
125 125
     /**
Please login to merge, or discard this patch.