@@ -89,11 +89,11 @@ |
||
| 89 | 89 | */ |
| 90 | 90 | protected function sendMail($email, $subject, $message, $format = self::FORMAT_TEXT, $replyTo = "") { |
| 91 | 91 | $headers = "From: " . $this->fromName . " <" . $this->fromEmail . ">\r\n"; |
| 92 | - $headers.= "Reply-To: " . $replyTo . "\r\n"; |
|
| 92 | + $headers .= "Reply-To: " . $replyTo . "\r\n"; |
|
| 93 | 93 | |
| 94 | 94 | if ($format == self::FORMAT_HTML) { |
| 95 | - $headers.= "MIME-Version: 1.0\r\n"; |
|
| 96 | - $headers.= "Content-type: text/html; charset=utf-8\r\n"; |
|
| 95 | + $headers .= "MIME-Version: 1.0\r\n"; |
|
| 96 | + $headers .= "Content-type: text/html; charset=utf-8\r\n"; |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /** |
@@ -98,15 +98,15 @@ discard block |
||
| 98 | 98 | public function getUrl($action, $id = null, $getParams = array()) { |
| 99 | 99 | $url = $this->controller . "/"; |
| 100 | 100 | if (!is_null($id)) { |
| 101 | - $url.= $action . "/" . $id; |
|
| 101 | + $url .= $action . "/" . $id; |
|
| 102 | 102 | } else { |
| 103 | - $url.= $action; |
|
| 103 | + $url .= $action; |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | if (!empty($getParams)) { |
| 107 | - $url.= "?"; |
|
| 107 | + $url .= "?"; |
|
| 108 | 108 | foreach ($getParams as $key => $value) { |
| 109 | - $url.= $key . "=" . $value; |
|
| 109 | + $url .= $key . "=" . $value; |
|
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | return $url; |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | public function tplPath() { |
| 121 | 121 | $path = $this->controller . "/" . $this->controller; |
| 122 | 122 | if (!empty($this->action)) { |
| 123 | - $path.= "_" . $this->action; |
|
| 123 | + $path .= "_" . $this->action; |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | return $path; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | } else { |
| 47 | 47 | $fieldValue = $newValue; |
| 48 | 48 | } |
| 49 | - $count ++; |
|
| 49 | + $count++; |
|
| 50 | 50 | } elseif (!empty($this->fieldsAliases)) { // look up for the field aliases |
| 51 | 51 | $fieldAliases = array_keys($this->fieldsAliases, $fieldName); |
| 52 | 52 | if (!empty($fieldAliases)) { |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | } else { |
| 59 | 59 | $fieldValue = $newValue; |
| 60 | 60 | } |
| 61 | - $count ++; |
|
| 61 | + $count++; |
|
| 62 | 62 | |
| 63 | 63 | break; |
| 64 | 64 | } |
@@ -13,10 +13,10 @@ |
||
| 13 | 13 | |
| 14 | 14 | $deepness = substr_count($_SERVER['SCRIPT_NAME'], "/") - 1; |
| 15 | 15 | |
| 16 | -$_PATH = $deepness>0 ? implode("", array_fill(0, $deepness, "../")) : "./"; |
|
| 16 | +$_PATH = $deepness > 0 ? implode("", array_fill(0, $deepness, "../")) : "./"; |
|
| 17 | 17 | |
| 18 | 18 | require_once($_PATH . "vendor/autoload.php"); |
| 19 | -spl_autoload_register(function ($className) { |
|
| 19 | +spl_autoload_register(function($className) { |
|
| 20 | 20 | global $_PATH; |
| 21 | 21 | |
| 22 | 22 | $path = explode("\\", $className); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | if ($type === 0) { |
| 38 | 38 | $errorTypes[] = "E_LOG_INFO"; |
| 39 | 39 | } else { |
| 40 | - for ($i = 0; $i < 15; $i++) { |
|
| 40 | + for ($i = 0; $i < 15; $i++) { |
|
| 41 | 41 | $errorType = self::friendlyErrorType($type & pow(2, $i)); |
| 42 | 42 | if (!empty($errorType)) { |
| 43 | 43 | $errorTypes[] = $errorType; |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | private static function friendlyErrorType($type) { |
| 60 | - switch($type) { |
|
| 60 | + switch ($type) { |
|
| 61 | 61 | case E_ERROR: // 1 |
| 62 | 62 | return 'E_ERROR'; |
| 63 | 63 | case E_WARNING: // 2 |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | if ($attributes['key'] === 'PRI') { |
| 39 | 39 | $idFieldName = $field; |
| 40 | 40 | } |
| 41 | - $fieldsListStr.= " " . DBCore::getPrintableFieldString($field, $attributes); |
|
| 41 | + $fieldsListStr .= " " . DBCore::getPrintableFieldString($field, $attributes); |
|
| 42 | 42 | } |
| 43 | 43 | $fieldsListStr = substr($fieldsListStr, 0, strlen($fieldsListStr) - 1); |
| 44 | 44 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | function getClassName($tableName) { |
| 70 | 70 | $underlinesReplaced = preg_replace_callback( |
| 71 | 71 | "/_([a-zA-Z]{1})/", |
| 72 | - function ($matches) { |
|
| 72 | + function($matches) { |
|
| 73 | 73 | return strtoupper($matches[1]); |
| 74 | 74 | }, |
| 75 | 75 | $tableName |
@@ -132,7 +132,7 @@ |
||
| 132 | 132 | */ |
| 133 | 133 | public static function reorderMessages() |
| 134 | 134 | { |
| 135 | - uasort(self::$messages, function ($a, $b) { |
|
| 135 | + uasort(self::$messages, function($a, $b) { |
|
| 136 | 136 | return $a->type <= $b->type; |
| 137 | 137 | }); |
| 138 | 138 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | $action = 'action' . ucfirst( |
| 34 | 34 | preg_replace_callback( |
| 35 | 35 | "#_([a-z])#", |
| 36 | - function ($matches) { |
|
| 36 | + function($matches) { |
|
| 37 | 37 | return strtoupper($matches[1]); |
| 38 | 38 | }, |
| 39 | 39 | $this->route->action |
@@ -29,10 +29,10 @@ discard block |
||
| 29 | 29 | public static function http_redirect($url, $params = [], $session = false) { |
| 30 | 30 | $paramsString = ""; |
| 31 | 31 | foreach ($params as $key => $value) { |
| 32 | - $paramsString.= "&" . $key . "=" . $value; |
|
| 32 | + $paramsString .= "&" . $key . "=" . $value; |
|
| 33 | 33 | } |
| 34 | 34 | if ($session) { |
| 35 | - $paramsString.= "&" . session_name() . "=" . session_id(); |
|
| 35 | + $paramsString .= "&" . session_name() . "=" . session_id(); |
|
| 36 | 36 | } |
| 37 | 37 | $paramsString = substr($paramsString, 1); |
| 38 | 38 | if ($paramsString) { |
@@ -132,18 +132,18 @@ discard block |
||
| 132 | 132 | $urlParts['path'] = '/'; |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - $sock = fsockopen($urlParts['host'], (isset($urlParts['port']) ? (int) $urlParts['port'] : 80), $errno, $errstr, 30); |
|
| 135 | + $sock = fsockopen($urlParts['host'], (isset($urlParts['port']) ? (int)$urlParts['port'] : 80), $errno, $errstr, 30); |
|
| 136 | 136 | if (!$sock) { |
| 137 | 137 | throw new HttpException("$errstr ($errno)"); |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | $request = "HEAD " . $urlParts['path'] . (isset($urlParts['query']) ? '?' . $urlParts['query'] : '') . " HTTP/1.1\r\n"; |
| 141 | - $request.= 'Host: ' . $urlParts['host'] . "\r\n"; |
|
| 142 | - $request.= "Connection: Close\r\n\r\n"; |
|
| 141 | + $request .= 'Host: ' . $urlParts['host'] . "\r\n"; |
|
| 142 | + $request .= "Connection: Close\r\n\r\n"; |
|
| 143 | 143 | fwrite($sock, $request); |
| 144 | 144 | $response = ''; |
| 145 | 145 | while (!feof($sock)) { |
| 146 | - $response.= fread($sock, 8192); |
|
| 146 | + $response .= fread($sock, 8192); |
|
| 147 | 147 | } |
| 148 | 148 | fclose($sock); |
| 149 | 149 | |
@@ -218,29 +218,29 @@ discard block |
||
| 218 | 218 | |
| 219 | 219 | // Data goes in the path for a GET request |
| 220 | 220 | if ($type == self::GET) { |
| 221 | - $parts['path'].= '?' . $postString; |
|
| 221 | + $parts['path'] .= '?' . $postString; |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | $request = "$type " . $parts['path'] . " HTTP/1.1\r\n"; |
| 225 | - $request.= "Host: " . $parts['host'] . "\r\n"; |
|
| 225 | + $request .= "Host: " . $parts['host'] . "\r\n"; |
|
| 226 | 226 | |
| 227 | 227 | if ($type == self::POST) { |
| 228 | - $request.= "Content-Type: application/x-www-form-urlencoded\r\n"; |
|
| 229 | - $request.= "Content-Length: " . strlen($postString) . "\r\n"; |
|
| 228 | + $request .= "Content-Type: application/x-www-form-urlencoded\r\n"; |
|
| 229 | + $request .= "Content-Length: " . strlen($postString) . "\r\n"; |
|
| 230 | 230 | } |
| 231 | - $request.= "Connection: Close\r\n"; |
|
| 232 | - $request.= "\r\n"; |
|
| 231 | + $request .= "Connection: Close\r\n"; |
|
| 232 | + $request .= "\r\n"; |
|
| 233 | 233 | |
| 234 | 234 | // Data goes in the request body for a POST request |
| 235 | 235 | if ($type == self::POST && isset($postString)) { |
| 236 | - $request.= $postString; |
|
| 236 | + $request .= $postString; |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | fwrite($sock, $request); |
| 240 | 240 | |
| 241 | 241 | $response = ""; |
| 242 | 242 | while (!feof($sock) && $result = fgets($sock)) { |
| 243 | - $response.= $result; |
|
| 243 | + $response .= $result; |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | fclose($sock); |