@@ -35,7 +35,7 @@ |
||
| 35 | 35 | /** |
| 36 | 36 | * Test singleton instance |
| 37 | 37 | * @param string $instanceClass |
| 38 | - * @return boolean |
|
| 38 | + * @return boolean|null |
|
| 39 | 39 | */ |
| 40 | 40 | public function checkSingletonInstance($instanceClass = '\CloudFramework\Core\CloudFrameworkApp') |
| 41 | 41 | { |
@@ -103,8 +103,8 @@ |
||
| 103 | 103 | /** |
| 104 | 104 | * Set a config parameter |
| 105 | 105 | * @param string $key |
| 106 | - * @param mixed $value |
|
| 107 | - * @return \CloudFramework\Core\ConfigLoader |
|
| 106 | + * @param string $value |
|
| 107 | + * @return ConfigLoader |
|
| 108 | 108 | */ |
| 109 | 109 | public function setConfigParam($key, $value = null) |
| 110 | 110 | { |
@@ -133,7 +133,7 @@ |
||
| 133 | 133 | $aux[$_key] = array(); |
| 134 | 134 | } |
| 135 | 135 | if ($keyCount > 0) { |
| 136 | - $aux[$_key] = $this->setConfigValue($this->getChildConfigKey($key), $value, $aux[$_key]); |
|
| 136 | + $aux[$_key] = $this->setConfigValue($this->getChildConfigKey($key), $value, $aux[$_key]); |
|
| 137 | 137 | } else { |
| 138 | 138 | $aux[$_key] = $value; |
| 139 | 139 | } |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | |
| 82 | 82 | /** |
| 83 | 83 | * Get query param |
| 84 | - * @param $key |
|
| 84 | + * @param string $key |
|
| 85 | 85 | * @return array|null |
| 86 | 86 | */ |
| 87 | 87 | public static function getQueryParam($key) |
@@ -1,9 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace CloudFramework\Core\Tool; |
| 3 | 3 | |
| 4 | -use CloudFramework\Helpers\MagicClass; |
|
| 5 | -use CloudFramework\Patterns\Singleton; |
|
| 6 | - |
|
| 7 | 4 | final class RequestParser |
| 8 | 5 | { |
| 9 | 6 | /** |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | public static function getRequestHeaders() |
| 14 | 14 | { |
| 15 | 15 | $headers = array(); |
| 16 | - if(function_exists("getallheaders")) { |
|
| 16 | + if (function_exists("getallheaders")) { |
|
| 17 | 17 | foreach (getallheaders() as $key => $value) { |
| 18 | 18 | $headers[strtolower($key)] = $value; |
| 19 | 19 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $query = array(); |
| 51 | 51 | try { |
| 52 | 52 | parse_str($_SERVER['QUERY_STRING'], $query); |
| 53 | - } catch(\Throwable $t) { |
|
| 53 | + } catch (\Throwable $t) { |
|
| 54 | 54 | syslog(LOG_ERR, $t->getMessage()); |
| 55 | 55 | } |
| 56 | 56 | return $query; |
@@ -1,4 +1,4 @@ |
||
| 1 | 1 | <?php |
| 2 | -require_once __DIR__.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'autoload.php'; |
|
| 2 | +require_once __DIR__ . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'autoload.php'; |
|
| 3 | 3 | $app = \CloudFramework\Core\CloudFrameworkApp::getInstance(); |
| 4 | 4 | $app->run(); |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | */ |
| 6 | 6 | spl_autoload_register(function($class) { |
| 7 | 7 | |
| 8 | - if(!function_exists("loadClass")) { |
|
| 8 | + if (!function_exists("loadClass")) { |
|
| 9 | 9 | /** |
| 10 | 10 | * Class Loader |
| 11 | 11 | * @param string $class |
@@ -160,7 +160,7 @@ |
||
| 160 | 160 | if ($singleton) { |
| 161 | 161 | $instance = $instanceReflector->getMethod("getInstance")->invoke(null); |
| 162 | 162 | } |
| 163 | - } catch(\Exception $e) { |
|
| 163 | + } catch (\Exception $e) { |
|
| 164 | 164 | $singleton = false; |
| 165 | 165 | } |
| 166 | 166 | if (!$singleton) { |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | * Class SingletonTrait |
| 7 | 7 | * @package CloudFramework\Helpers |
| 8 | 8 | */ |
| 9 | -Trait SingletonTrait { |
|
| 9 | +trait SingletonTrait { |
|
| 10 | 10 | |
| 11 | 11 | private static $instance = array(); |
| 12 | 12 | /** |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | * Class MagicClass |
| 6 | 6 | * @package CloudFramework\Helpers |
| 7 | 7 | */ |
| 8 | -Trait MagicClass { |
|
| 8 | +trait MagicClass { |
|
| 9 | 9 | /** |
| 10 | 10 | * Magic setter |
| 11 | 11 | * @param string $variable |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | * Class Response |
| 6 | 6 | * @package CloudFramework\Helpers |
| 7 | 7 | */ |
| 8 | -Trait Response |
|
| 8 | +trait Response |
|
| 9 | 9 | { |
| 10 | 10 | |
| 11 | 11 | public function dumpText($text) |