@@ -35,7 +35,7 @@ |
||
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']); |
@@ -40,7 +40,7 @@ |
||
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'; |
@@ -97,9 +97,9 @@ discard block |
||
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 |
||
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; |
@@ -74,7 +74,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -118,16 +118,16 @@ |
||
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: |
@@ -67,6 +67,6 @@ |
||
67 | 67 | return 'error'; |
68 | 68 | } |
69 | 69 | |
70 | - return (int)$load . '%'; |
|
70 | + return (int)$load.'%'; |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | \ No newline at end of file |
@@ -93,22 +93,22 @@ |
||
93 | 93 | } |
94 | 94 | $this->baseUrlNoLang = $this->baseUrl; |
95 | 95 | if (App::$Request->languageInPath() && App::$Request->getLanguage() !== null) { |
96 | - $this->baseUrl .= '/' . App::$Request->getLanguage(); |
|
96 | + $this->baseUrl .= '/'.App::$Request->getLanguage(); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | // build vendor libs alias |
100 | - $this->vendorNamedLibrary['js']['jquery'] = $this->scriptUrl . '/vendor/bower/jquery/dist/jquery.min.js'; |
|
101 | - $this->vendorNamedLibrary['css']['bootstrap'] = $this->scriptUrl . '/vendor/bower/bootstrap/dist/css/bootstrap.min.css'; |
|
102 | - $this->vendorNamedLibrary['js']['bootstrap'] = $this->scriptUrl . '/vendor/bower/bootstrap/dist/js/bootstrap.min.js'; |
|
103 | - $this->vendorNamedLibrary['css']['fa'] = $this->scriptUrl . '/vendor/bower/components-font-awesome/css/font-awesome.min.css'; |
|
104 | - $this->vendorNamedLibrary['js']['jquery-ui'] = $this->scriptUrl . '/vendor/bower/jquery-ui/jquery-ui.min.js'; |
|
105 | - $this->vendorNamedLibrary['css']['jquery-ui'] = $this->scriptUrl . '/vendor/bower/jquery-ui/themes/base/jquery-ui.min.css'; |
|
100 | + $this->vendorNamedLibrary['js']['jquery'] = $this->scriptUrl.'/vendor/bower/jquery/dist/jquery.min.js'; |
|
101 | + $this->vendorNamedLibrary['css']['bootstrap'] = $this->scriptUrl.'/vendor/bower/bootstrap/dist/css/bootstrap.min.css'; |
|
102 | + $this->vendorNamedLibrary['js']['bootstrap'] = $this->scriptUrl.'/vendor/bower/bootstrap/dist/js/bootstrap.min.js'; |
|
103 | + $this->vendorNamedLibrary['css']['fa'] = $this->scriptUrl.'/vendor/bower/components-font-awesome/css/font-awesome.min.css'; |
|
104 | + $this->vendorNamedLibrary['js']['jquery-ui'] = $this->scriptUrl.'/vendor/bower/jquery-ui/jquery-ui.min.js'; |
|
105 | + $this->vendorNamedLibrary['css']['jquery-ui'] = $this->scriptUrl.'/vendor/bower/jquery-ui/themes/base/jquery-ui.min.css'; |
|
106 | 106 | |
107 | 107 | $themeAll = App::$Properties->get('theme'); |
108 | 108 | if (!isset($themeAll[env_name]) || Str::length($themeAll[env_name]) < 1) { |
109 | 109 | $themeAll[env_name] = 'default'; |
110 | 110 | } |
111 | - $this->currentViewUrl = $this->scriptUrl . '/Apps/View/' . env_name . '/' . $themeAll[env_name]; |
|
111 | + $this->currentViewUrl = $this->scriptUrl.'/Apps/View/'.env_name.'/'.$themeAll[env_name]; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | public function on($event, \Closure $callback) |
39 | 39 | { |
40 | 40 | // check if event is a single string and parse it to array single item |
41 | - if (! Obj::isArray($event)) { |
|
41 | + if (!Obj::isArray($event)) { |
|
42 | 42 | $event = [$event]; |
43 | 43 | } |
44 | 44 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public static function makeBoot($loader = false) |
109 | 109 | { |
110 | - $controllers = [root . '/Apps/Controller/' . env_name]; |
|
110 | + $controllers = [root.'/Apps/Controller/'.env_name]; |
|
111 | 111 | // get custom apps directories from composer autoloader maps |
112 | 112 | if ($loader !== false) { |
113 | 113 | $sources = $loader->getPrefixes(); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | // each every one add a new path to controllers map |
117 | 117 | $controllers = []; |
118 | 118 | foreach ($sources['Apps\\'] as $path) { |
119 | - $controllers[] = $path . '/Apps/Controller/' . env_name; |
|
119 | + $controllers[] = $path.'/Apps/Controller/'.env_name; |
|
120 | 120 | } |
121 | 121 | } |
122 | 122 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | // foreach all files in list |
132 | 132 | foreach ($list as $file) { |
133 | 133 | // define full class name with namespace |
134 | - $class = 'Apps\Controller\\' . env_name . '\\' . Str::cleanExtension($file); |
|
134 | + $class = 'Apps\Controller\\'.env_name.'\\'.Str::cleanExtension($file); |
|
135 | 135 | // check if class exists (must be loaded over autoloader) |
136 | 136 | if (class_exists($class)) { |
137 | 137 | // check if static method boot is exists |
@@ -46,9 +46,9 @@ discard block |
||
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] = @include(root . '/Private/Config/' . $configFile); |
|
49 | + $configFile = ucfirst(Str::lowerCase($configName)).'.php'; |
|
50 | + if (File::exist('/Private/Config/'.$configFile)) { |
|
51 | + $this->data[$configName] = @include(root.'/Private/Config/'.$configFile); |
|
52 | 52 | return true; |
53 | 53 | } |
54 | 54 | |
@@ -139,11 +139,11 @@ discard block |
||
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 | } |