@@ -34,10 +34,10 @@ |
||
| 34 | 34 | |
| 35 | 35 | protected function init() |
| 36 | 36 | { |
| 37 | - $action = 'action'.ucfirst( |
|
| 37 | + $action = 'action' . ucfirst( |
|
| 38 | 38 | preg_replace_callback( |
| 39 | 39 | '#_([a-z])#', |
| 40 | - function ($matches) { |
|
| 40 | + function($matches) { |
|
| 41 | 41 | return strtoupper($matches[1]); |
| 42 | 42 | }, |
| 43 | 43 | $this->route->action |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | public function __construct($attribs = [], $template = null, $show = false) |
| 30 | 30 | { |
| 31 | 31 | if (empty($template)) { |
| 32 | - $template = __DIR__.self::DEFAULT_TEMPLATE; |
|
| 32 | + $template = __DIR__ . self::DEFAULT_TEMPLATE; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | if ($show) { |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | $this->buttons = $buttons; |
| 39 | 39 | |
| 40 | 40 | if (empty($template)) { |
| 41 | - $template = __DIR__.self::DEFAULT_TEMPLATE; |
|
| 41 | + $template = __DIR__ . self::DEFAULT_TEMPLATE; |
|
| 42 | 42 | } |
| 43 | 43 | parent::__construct($attributesList, $template); |
| 44 | 44 | } |
@@ -92,8 +92,8 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | protected function sendMail($email, $subject, $message, $format = self::FORMAT_TEXT, $replyTo = '') |
| 94 | 94 | { |
| 95 | - $headers = 'From: '.$this->fromName.' <'.$this->fromEmail.">\r\n"; |
|
| 96 | - $headers .= 'Reply-To: '.$replyTo."\r\n"; |
|
| 95 | + $headers = 'From: ' . $this->fromName . ' <' . $this->fromEmail . ">\r\n"; |
|
| 96 | + $headers .= 'Reply-To: ' . $replyTo . "\r\n"; |
|
| 97 | 97 | |
| 98 | 98 | if ($format == self::FORMAT_HTML) { |
| 99 | 99 | $headers .= "MIME-Version: 1.0\r\n"; |
@@ -154,9 +154,9 @@ discard block |
||
| 154 | 154 | $_EMAIL = $params; |
| 155 | 155 | |
| 156 | 156 | ob_start(); |
| 157 | - include $this->tplFolder.$languageCode.'/'.$template.'.tpl.php'; |
|
| 157 | + include $this->tplFolder . $languageCode . '/' . $template . '.tpl.php'; |
|
| 158 | 158 | if (!empty($this->signatureTpl)) { |
| 159 | - include $this->tplFolder.$languageCode.'/'.$this->signatureTpl; |
|
| 159 | + include $this->tplFolder . $languageCode . '/' . $this->signatureTpl; |
|
| 160 | 160 | } |
| 161 | 161 | $message = ob_get_contents(); |
| 162 | 162 | ob_end_clean(); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | return $this; |
| 99 | 99 | } else { |
| 100 | - throw new \Exception("Object '".get_class($this)."' hasn't field '".$fieldName."'"); |
|
| 100 | + throw new \Exception("Object '" . get_class($this) . "' hasn't field '" . $fieldName . "'"); |
|
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | if (isset($this->fieldsList[$fieldName])) { |
| 142 | 142 | return $this->fieldsList[$fieldName]; |
| 143 | 143 | } else { |
| 144 | - throw new \Exception("Object '".get_class($this)."' hasn't field '".$fieldName."'"); |
|
| 144 | + throw new \Exception("Object '" . get_class($this) . "' hasn't field '" . $fieldName . "'"); |
|
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | 147 | |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | */ |
| 227 | 227 | public function __set($fieldName, $fieldValue) |
| 228 | 228 | { |
| 229 | - return call_user_func_array([$this, 'set'.ucfirst($fieldName)], [$fieldValue]); |
|
| 229 | + return call_user_func_array([$this, 'set' . ucfirst($fieldName)], [$fieldValue]); |
|
| 230 | 230 | //return $this->setFieldValue($this->getFieldName($fieldName), $fieldValue); |
| 231 | 231 | } |
| 232 | 232 | |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | */ |
| 240 | 240 | public function __get($fieldName) |
| 241 | 241 | { |
| 242 | - return call_user_func_array([$this, 'get'.ucfirst($fieldName)], []); |
|
| 242 | + return call_user_func_array([$this, 'get' . ucfirst($fieldName)], []); |
|
| 243 | 243 | //return $this->getFieldValue($this->getFieldName($fieldName)); |
| 244 | 244 | } |
| 245 | 245 | } |
@@ -102,9 +102,9 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function getUrl($action, $id = null, $getParams = []) |
| 104 | 104 | { |
| 105 | - $url = $this->controller.'/'; |
|
| 105 | + $url = $this->controller . '/'; |
|
| 106 | 106 | if (!is_null($id)) { |
| 107 | - $url .= $action.'/'.$id; |
|
| 107 | + $url .= $action . '/' . $id; |
|
| 108 | 108 | } else { |
| 109 | 109 | $url .= $action; |
| 110 | 110 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | if (!empty($getParams)) { |
| 113 | 113 | $url .= '?'; |
| 114 | 114 | foreach ($getParams as $key => $value) { |
| 115 | - $url .= $key.'='.$value; |
|
| 115 | + $url .= $key . '=' . $value; |
|
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | 118 | |
@@ -126,9 +126,9 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function tplPath() |
| 128 | 128 | { |
| 129 | - $path = $this->controller.'/'.$this->controller; |
|
| 129 | + $path = $this->controller . '/' . $this->controller; |
|
| 130 | 130 | if (!empty($this->action)) { |
| 131 | - $path .= '_'.$this->action; |
|
| 131 | + $path .= '_' . $this->action; |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | return $path; |
@@ -230,8 +230,8 @@ discard block |
||
| 230 | 230 | return ''; |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | - if (!self::validateRegexp($url, '#^'.$protocol.'://.+#')) { |
|
| 234 | - $url = $protocol.'://'.$url; |
|
| 233 | + if (!self::validateRegexp($url, '#^' . $protocol . '://.+#')) { |
|
| 234 | + $url = $protocol . '://' . $url; |
|
| 235 | 235 | } |
| 236 | 236 | $url = preg_replace('#/{3,}#', '//', $url); |
| 237 | 237 | |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | public static function validateDouble($fieldName) |
| 361 | 361 | { |
| 362 | 362 | $fieldValue = trim(Request::getFieldValue($fieldName)); |
| 363 | - $doubleValue = (float) $fieldValue; |
|
| 363 | + $doubleValue = (float)$fieldValue; |
|
| 364 | 364 | if (!validateNotEmpty($fieldName)) { |
| 365 | 365 | Errors::saveErrorFor($fieldName, \__ERRORS::FIELD_CANT_BE_EMPTY); |
| 366 | 366 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public static function line($str = '') |
| 61 | 61 | { |
| 62 | - self::output($str."\n"); |
|
| 62 | + self::output($str . "\n"); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $str = str_replace('{{time}}', date($format, $time), $str); |
| 82 | 82 | self::line($str); |
| 83 | 83 | } else { |
| 84 | - self::line(date($format, $time).' '.$str); |
|
| 84 | + self::line(date($format, $time) . ' ' . $str); |
|
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
@@ -98,11 +98,11 @@ discard block |
||
| 98 | 98 | public static function message($msgType, $str, $format = "\[Y-m-d H:i:s\]", $time = null) |
| 99 | 99 | { |
| 100 | 100 | if (strpos($str, '{{time}}') === false) { |
| 101 | - $str = '{{time}} '.$str; |
|
| 101 | + $str = '{{time}} ' . $str; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | self::log( |
| 105 | - '<b><font color="'.$msgType.'">'.$str.'</font></b>', |
|
| 105 | + '<b><font color="' . $msgType . '">' . $str . '</font></b>', |
|
| 106 | 106 | $format, |
| 107 | 107 | $time |
| 108 | 108 | ); |
@@ -88,14 +88,14 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public static function isDoubleString($input) |
| 90 | 90 | { |
| 91 | - $doubleValue = (float) $input; |
|
| 92 | - $stringValue = str_replace(',', '.', (string) $input); |
|
| 91 | + $doubleValue = (float)$input; |
|
| 92 | + $stringValue = str_replace(',', '.', (string)$input); |
|
| 93 | 93 | |
| 94 | 94 | if (is_numeric($stringValue)) { |
| 95 | 95 | return true; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - if ($stringValue === (string) $doubleValue) { |
|
| 98 | + if ($stringValue === (string)$doubleValue) { |
|
| 99 | 99 | return true; |
| 100 | 100 | } |
| 101 | 101 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public static function toDouble($value) |
| 113 | 113 | { |
| 114 | - return (float) str_replace(',', '.', (string) $value); |
|
| 114 | + return (float)str_replace(',', '.', (string)$value); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |