@@ -108,8 +108,8 @@ |
||
108 | 108 | { |
109 | 109 | foreach ($options as $option => $value) |
110 | 110 | { |
111 | - if (property_exists(__CLASS__, strtolower($option)) && method_exists($this, 'set'.$option)) |
|
112 | - $this->{'set'.$option}($value); |
|
111 | + if (property_exists(__CLASS__, strtolower($option)) && method_exists($this, 'set' . $option)) |
|
112 | + $this->{'set' . $option}($value); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | if (!($this->socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) |
@@ -74,7 +74,7 @@ |
||
74 | 74 | public function listen(Array $eventHandlers = array()) |
75 | 75 | { |
76 | 76 | $event = $eventHandlers; |
77 | - $clousure = function(){}; |
|
77 | + $clousure = function() {}; |
|
78 | 78 | |
79 | 79 | if (!array_key_exists('success', $event)) |
80 | 80 | $event["success"] = $clousure; |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | $ht = $this->http; |
30 | 30 | |
31 | 31 | $this->http->writeStatus($ht::HTTP_UNAUTHORIZED); |
32 | - header('WWW-Authenticate: Basic realm="'.$this->realm.'"'); |
|
33 | - die('Error ' . $ht::HTTP_UNAUTHORIZED .' (' . $this->http->getStatusText($ht::HTTP_UNAUTHORIZED) . ')!!'); |
|
32 | + header('WWW-Authenticate: Basic realm="' . $this->realm . '"'); |
|
33 | + die('Error ' . $ht::HTTP_UNAUTHORIZED . ' (' . $this->http->getStatusText($ht::HTTP_UNAUTHORIZED) . ')!!'); |
|
34 | 34 | } |
35 | 35 | } |
36 | 36 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | public function response() |
77 | 77 | { |
78 | 78 | $status = http_response_code(); |
79 | - $this->response = 'Error ' . $status .' (' . $this->http->getStatusText($status) . ')!!'; |
|
79 | + $this->response = 'Error ' . $status . ' (' . $this->http->getStatusText($status) . ')!!'; |
|
80 | 80 | echo $this->response; |
81 | 81 | } |
82 | 82 | } |
83 | 83 | \ No newline at end of file |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | $ht = $this->http; |
30 | 30 | |
31 | 31 | $this->http->writeStatus($ht::HTTP_UNAUTHORIZED); |
32 | - header('WWW-Authenticate: Digest realm="'.$this->realm.'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($this->realm).'"'); |
|
33 | - die('Error ' . $ht::HTTP_UNAUTHORIZED .' (' . $this->http->getStatusText($ht::HTTP_UNAUTHORIZED) . ')!!'); |
|
32 | + header('WWW-Authenticate: Digest realm="' . $this->realm . '",qop="auth",nonce="' . uniqid() . '",opaque="' . md5($this->realm) . '"'); |
|
33 | + die('Error ' . $ht::HTTP_UNAUTHORIZED . ' (' . $this->http->getStatusText($ht::HTTP_UNAUTHORIZED) . ')!!'); |
|
34 | 34 | } |
35 | 35 | } |
36 | 36 | |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | $A1 = md5($data['username'] . ':' . $this->realm . ':' . $this->whiteList[$data['username']]); |
53 | - $A2 = md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']); |
|
54 | - $valid_response = md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2); |
|
53 | + $A2 = md5($_SERVER['REQUEST_METHOD'] . ':' . $data['uri']); |
|
54 | + $valid_response = md5($A1 . ':' . $data['nonce'] . ':' . $data['nc'] . ':' . $data['cnonce'] . ':' . $data['qop'] . ':' . $A2); |
|
55 | 55 | |
56 | 56 | if ($data['response'] != $valid_response) |
57 | 57 | { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | public function response() |
98 | 98 | { |
99 | 99 | $status = http_response_code(); |
100 | - $this->response = 'Error ' . $status .' (' . $this->http->getStatusText($status) . ')!!'; |
|
100 | + $this->response = 'Error ' . $status . ' (' . $this->http->getStatusText($status) . ')!!'; |
|
101 | 101 | echo $this->response; |
102 | 102 | } |
103 | 103 | } |
104 | 104 | \ No newline at end of file |
@@ -156,8 +156,8 @@ |
||
156 | 156 | { |
157 | 157 | foreach ($options as $option => $value) |
158 | 158 | { |
159 | - if (property_exists(__CLASS__, strtolower($option)) && method_exists($this, 'set'.$option)) |
|
160 | - $this->{'set'.$option}($value); |
|
159 | + if (property_exists(__CLASS__, strtolower($option)) && method_exists($this, 'set' . $option)) |
|
160 | + $this->{'set' . $option}($value); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | # HTTP instance |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public function send($from, $to, $subject, $body) |
116 | 116 | { |
117 | - $headers = array ( |
|
117 | + $headers = array( |
|
118 | 118 | 'From' => $from, |
119 | 119 | 'To' => $to, |
120 | 120 | 'Subject' => $subject, |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | $smtp = \Mail::factory( |
125 | 125 | 'smtp', |
126 | - array ('host' => $this->host, 'auth' => false) |
|
126 | + array('host' => $this->host, 'auth' => false) |
|
127 | 127 | ); |
128 | 128 | |
129 | 129 | $mail = $smtp->send($to, $headers, $body); |
@@ -58,7 +58,7 @@ |
||
58 | 58 | |
59 | 59 | $constName = null; |
60 | 60 | |
61 | - foreach ($constants as $name => $value ) |
|
61 | + foreach ($constants as $name => $value) |
|
62 | 62 | { |
63 | 63 | if ($value == $code) |
64 | 64 | { |
@@ -60,7 +60,7 @@ |
||
60 | 60 | |
61 | 61 | if (!empty($string)) |
62 | 62 | { |
63 | - $data = json_decode($string, true); |
|
63 | + $data = json_decode($string, true); |
|
64 | 64 | |
65 | 65 | # json_encode can return TRUE, FALSE or NULL (http://php.net/manual/en/function.json-decode.php) |
66 | 66 | if (is_null($data) || $data === false) |
@@ -132,8 +132,8 @@ |
||
132 | 132 | * This instruction include each module declared in application.config.php |
133 | 133 | * Each module has an autoloader to load its classes (controllers and models) |
134 | 134 | */ |
135 | - if (file_exists("module/".$module."/Module.php")) |
|
136 | - include("module/".$module."/Module.php"); |
|
135 | + if (file_exists("module/" . $module . "/Module.php")) |
|
136 | + include("module/" . $module . "/Module.php"); |
|
137 | 137 | |
138 | 138 | spl_autoload_register($module . "\Module::loader"); |
139 | 139 | } |