@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | public static function getClassToCall($action) |
| 23 | 23 | { |
| 24 | 24 | Logger::log('Getting class to call for executing the request action', LOG_DEBUG, $action); |
| 25 | - $actionClass = class_exists($action["class"]) ? $action["class"] : "\\" . $action["class"]; |
|
| 25 | + $actionClass = class_exists($action["class"]) ? $action["class"] : "\\".$action["class"]; |
|
| 26 | 26 | $class = (method_exists($actionClass, "getInstance")) ? $actionClass::getInstance() : new $actionClass; |
| 27 | 27 | return $class; |
| 28 | 28 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $expr = preg_quote($expr, '/'); |
| 109 | 109 | $expr = str_replace('###', '(.*)', $expr); |
| 110 | 110 | $expr2 = preg_replace('/\(\.\*\)$/', '', $expr); |
| 111 | - $matched = preg_match('/^' . $expr . '\/?$/i', $path) || preg_match('/^' . $expr2 . '?$/i', $path); |
|
| 111 | + $matched = preg_match('/^'.$expr.'\/?$/i', $path) || preg_match('/^'.$expr2.'?$/i', $path); |
|
| 112 | 112 | return $matched; |
| 113 | 113 | } |
| 114 | 114 | |
@@ -119,8 +119,8 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | public static function extractDomainInfo(\ReflectionClass $class, $domain) |
| 121 | 121 | { |
| 122 | - $path = dirname($class->getFileName()) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR; |
|
| 123 | - $path = realpath($path) . DIRECTORY_SEPARATOR; |
|
| 122 | + $path = dirname($class->getFileName()).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR; |
|
| 123 | + $path = realpath($path).DIRECTORY_SEPARATOR; |
|
| 124 | 124 | $tpl_path = "templates"; |
| 125 | 125 | $public_path = "public"; |
| 126 | 126 | $model_path = "models"; |
@@ -130,13 +130,13 @@ discard block |
||
| 130 | 130 | $model_path = ucfirst($model_path); |
| 131 | 131 | } |
| 132 | 132 | if ($class->hasConstant("TPL")) { |
| 133 | - $tpl_path .= DIRECTORY_SEPARATOR . $class->getConstant("TPL"); |
|
| 133 | + $tpl_path .= DIRECTORY_SEPARATOR.$class->getConstant("TPL"); |
|
| 134 | 134 | } |
| 135 | 135 | return [ |
| 136 | 136 | "base" => $path, |
| 137 | - "template" => $path . $tpl_path, |
|
| 138 | - "model" => $path . $model_path, |
|
| 139 | - "public" => $path . $public_path, |
|
| 137 | + "template" => $path.$tpl_path, |
|
| 138 | + "model" => $path.$model_path, |
|
| 139 | + "public" => $path.$public_path, |
|
| 140 | 140 | ]; |
| 141 | 141 | } |
| 142 | 142 | |
@@ -158,9 +158,9 @@ discard block |
||
| 158 | 158 | if (count($parameters) > 0) foreach ($parameters as $param) { |
| 159 | 159 | if ($param->isOptional() && !is_array($param->getDefaultValue())) { |
| 160 | 160 | $params[$param->getName()] = $param->getDefaultValue(); |
| 161 | - $default = str_replace('{' . $param->getName() . '}', $param->getDefaultValue(), $regex); |
|
| 161 | + $default = str_replace('{'.$param->getName().'}', $param->getDefaultValue(), $regex); |
|
| 162 | 162 | } |
| 163 | - } else $default = $regex; |
|
| 163 | + }else $default = $regex; |
|
| 164 | 164 | |
| 165 | 165 | return array($regex, $default, $params); |
| 166 | 166 | } |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | $default = str_replace('{__DOMAIN__}', $module, $default); |
| 241 | 241 | $httpMethod = RouterHelper::extractReflectionHttpMethod($docComments); |
| 242 | 242 | $label = RouterHelper::extractReflectionLabel(str_replace('{__API__}', $api, $docComments)); |
| 243 | - $route = $httpMethod . "#|#" . $regex; |
|
| 243 | + $route = $httpMethod."#|#".$regex; |
|
| 244 | 244 | $route = preg_replace('/(\\r|\\f|\\t|\\n)/', '', $route); |
| 245 | 245 | $info = [ |
| 246 | 246 | "method" => $method->getName(), |