@@ -108,6 +108,7 @@ |
||
108 | 108 | /** |
109 | 109 | * SERVERパラメータ取得 |
110 | 110 | * @param string パラメータキー |
111 | + * @param string $key |
|
111 | 112 | */ |
112 | 113 | private function server($key) |
113 | 114 | { |
@@ -67,6 +67,7 @@ discard block |
||
67 | 67 | /** |
68 | 68 | * Cache-Controlを設定 |
69 | 69 | * @param String Cache-Control |
70 | + * @param string $cacheControl |
|
70 | 71 | */ |
71 | 72 | public function setCacheControl($cacheControl) |
72 | 73 | { |
@@ -76,6 +77,7 @@ discard block |
||
76 | 77 | /** |
77 | 78 | * Pragmaを設定 |
78 | 79 | * @param String Pragma |
80 | + * @param string $pragma |
|
79 | 81 | */ |
80 | 82 | public function setPragma($pragma) |
81 | 83 | { |
@@ -86,6 +88,7 @@ discard block |
||
86 | 88 | * MimeTypeを設定 |
87 | 89 | * ファイルタイプにより指定 |
88 | 90 | * @param String ファイルタイプ |
91 | + * @param string $fileType |
|
89 | 92 | */ |
90 | 93 | public function setType($fileType) |
91 | 94 | { |
@@ -167,6 +170,7 @@ discard block |
||
167 | 170 | /** |
168 | 171 | * Content-Lengthを設定 |
169 | 172 | * @param Integer Content-Length |
173 | + * @param integer $contentLength |
|
170 | 174 | */ |
171 | 175 | public function setContentLength($contentLength) |
172 | 176 | { |
@@ -187,6 +191,7 @@ discard block |
||
187 | 191 | /** |
188 | 192 | * Content-Transfer-Encodingを設定 |
189 | 193 | * @param String エンコーディング方法 |
194 | + * @param string $contentTransferEncoding |
|
190 | 195 | */ |
191 | 196 | public function setContentTransferEncoding($contentTransferEncoding) |
192 | 197 | { |
@@ -196,6 +201,7 @@ discard block |
||
196 | 201 | /** |
197 | 202 | * Expiresを設定 |
198 | 203 | * @param Integer 有効期限 |
204 | + * @param integer $expires |
|
199 | 205 | */ |
200 | 206 | public function setExpires($expires) |
201 | 207 | { |
@@ -205,6 +211,7 @@ discard block |
||
205 | 211 | /** |
206 | 212 | * レスポンスボディを設定 |
207 | 213 | * @param String レスポンスボディ |
214 | + * @param string $body |
|
208 | 215 | */ |
209 | 216 | public function setBody($body) |
210 | 217 | { |
@@ -504,6 +511,7 @@ discard block |
||
504 | 511 | /** |
505 | 512 | * 指定したステータスコードのページに遷移 |
506 | 513 | * @param Integer ステータスコード |
514 | + * @param integer $statusCode |
|
507 | 515 | */ |
508 | 516 | public function move($statusCode) |
509 | 517 | { |
@@ -545,6 +553,7 @@ discard block |
||
545 | 553 | /** |
546 | 554 | * HTMLテンプレート |
547 | 555 | * @param String 表示内容 |
556 | + * @param string $content |
|
548 | 557 | * @return String HTML |
549 | 558 | */ |
550 | 559 | private function bodyTemplate($content) |
@@ -236,7 +236,7 @@ |
||
236 | 236 | { |
237 | 237 | // StatusCode |
238 | 238 | $headerMessage = 'HTTP/' . self::HTTP_VERSION . ' ' . |
239 | - $this->statusCode . ' ' . $this->status[$this->statusCode]; |
|
239 | + $this->statusCode . ' ' . $this->status[$this->statusCode]; |
|
240 | 240 | header($headerMessage); |
241 | 241 | |
242 | 242 | // Redirect |
@@ -155,11 +155,11 @@ discard block |
||
155 | 155 | public function setStatusCode($statusCode) |
156 | 156 | { |
157 | 157 | if (!is_string($statusCode) && !is_int($statusCode)) { |
158 | - throw new ConnectionException("Invalid status code format: " . strval($statusCode)); |
|
158 | + throw new ConnectionException("Invalid status code format: ".strval($statusCode)); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | if (!array_key_exists($statusCode, $this->status)) { |
162 | - throw new ConnectionException("Unknown status code: " . $statusCode); |
|
162 | + throw new ConnectionException("Unknown status code: ".$statusCode); |
|
163 | 163 | } |
164 | 164 | $this->statusCode = $statusCode; |
165 | 165 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | public function setContentDisposition($filename) |
181 | 181 | { |
182 | 182 | if (file_exists($filename)) { |
183 | - $this->contentDisposition = 'attachement; filename="'. basename($filename) . '"'; |
|
183 | + $this->contentDisposition = 'attachement; filename="'.basename($filename).'"'; |
|
184 | 184 | } |
185 | 185 | } |
186 | 186 | |
@@ -235,43 +235,43 @@ discard block |
||
235 | 235 | public function header() |
236 | 236 | { |
237 | 237 | // StatusCode |
238 | - $headerMessage = 'HTTP/' . self::HTTP_VERSION . ' ' . |
|
239 | - $this->statusCode . ' ' . $this->status[$this->statusCode]; |
|
238 | + $headerMessage = 'HTTP/'.self::HTTP_VERSION.' '. |
|
239 | + $this->statusCode.' '.$this->status[$this->statusCode]; |
|
240 | 240 | header($headerMessage); |
241 | 241 | |
242 | 242 | // Redirect |
243 | 243 | if (intval($this->statusCode) === 301) { |
244 | - header('Location: ' . $this->location); |
|
244 | + header('Location: '.$this->location); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | // Content-Type |
248 | - header('Content-Type: ' . $this->mimeType . '; charset=' . $this->charset); |
|
248 | + header('Content-Type: '.$this->mimeType.'; charset='.$this->charset); |
|
249 | 249 | |
250 | 250 | // Content-Length |
251 | 251 | if ($this->contentLength === null) { |
252 | 252 | $this->contentLength = $this->bytelen($this->body); |
253 | 253 | } |
254 | - header('Content-Length: ' . $this->contentLength); |
|
254 | + header('Content-Length: '.$this->contentLength); |
|
255 | 255 | |
256 | 256 | // Content-Disposition |
257 | 257 | if ($this->contentDisposition !== null) { |
258 | - header('Content-Disposition: ' . $this->contentDisposition); |
|
258 | + header('Content-Disposition: '.$this->contentDisposition); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | // Content-Transfer-Encoding |
262 | 262 | if ($this->contentTransferEncoding !== null) { |
263 | - header('Content-Transfer-Encoding: ' . $this->contentTransferEncoding); |
|
263 | + header('Content-Transfer-Encoding: '.$this->contentTransferEncoding); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | // Cache-Control |
267 | - header('Cache-Control: ' . $this->cacheControl); |
|
267 | + header('Cache-Control: '.$this->cacheControl); |
|
268 | 268 | |
269 | 269 | // Pragma |
270 | - header('Pragma: ' . $this->pragma); |
|
270 | + header('Pragma: '.$this->pragma); |
|
271 | 271 | |
272 | 272 | // Expires |
273 | 273 | if ($this->expires !== null) { |
274 | - header('Expires: ' . $this->expires); |
|
274 | + header('Expires: '.$this->expires); |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | // X-Content-Type-Options |
@@ -279,20 +279,20 @@ discard block |
||
279 | 279 | |
280 | 280 | // Access-Control-Allow-Origin |
281 | 281 | if (!empty($this->accessControlAllowOrigin)) { |
282 | - header('Access-Control-Allow-Origin: ' . implode(',', $this->accessControlAllowOrigin)); |
|
282 | + header('Access-Control-Allow-Origin: '.implode(',', $this->accessControlAllowOrigin)); |
|
283 | 283 | } |
284 | 284 | |
285 | 285 | // X-Frame-Options |
286 | 286 | if ($this->xframeOptions !== null) { |
287 | - header('X-Frame-Options: ' . $this->xframeOptions); |
|
287 | + header('X-Frame-Options: '.$this->xframeOptions); |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | // X-XSS-Protection |
291 | 291 | if ($this->xxssProtection !== null) { |
292 | - header('X-XSS-Protection: ' . $this->xxssProtection); |
|
292 | + header('X-XSS-Protection: '.$this->xxssProtection); |
|
293 | 293 | } |
294 | 294 | |
295 | - $this->logger->info("HTTP access occured: status code " . $this->statusCode); |
|
295 | + $this->logger->info("HTTP access occured: status code ".$this->statusCode); |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | /** |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | ob_clean(); // これまでの出力バッファをクリア |
511 | 511 | $statusCode = array_key_exists($statusCode, $this->status) ? $statusCode : 500; |
512 | 512 | $this->setStatusCode($statusCode); |
513 | - $bodyMessage = $statusCode . ' ' . $this->status[$statusCode]; |
|
513 | + $bodyMessage = $statusCode.' '.$this->status[$statusCode]; |
|
514 | 514 | $this->setBody($this->bodyTemplate($bodyMessage)); |
515 | 515 | $this->send(); |
516 | 516 | exit; |
@@ -49,6 +49,10 @@ |
||
49 | 49 | * @param string Cookieを有効にするドメイン |
50 | 50 | * @param boolean Secure属性を有効にする |
51 | 51 | * @param boolean HttpOnly属性を有効にする |
52 | + * @param string $path |
|
53 | + * @param string $domain |
|
54 | + * @param boolean $secure |
|
55 | + * @param boolean $httpOnly |
|
52 | 56 | */ |
53 | 57 | private function initialize($expire, $path, $domain, $secure, $httpOnly) |
54 | 58 | { |
@@ -59,6 +59,7 @@ discard block |
||
59 | 59 | /** |
60 | 60 | * コンストラクタ |
61 | 61 | * @param string ログファイルパス |
62 | + * @param string $configPath |
|
62 | 63 | */ |
63 | 64 | private function __construct($configPath) |
64 | 65 | { |
@@ -75,7 +76,7 @@ discard block |
||
75 | 76 | |
76 | 77 | /** |
77 | 78 | * インスタンスを返却する |
78 | - * @return WebStream\Module\Logger ロガーインスタンス |
|
79 | + * @return Logger ロガーインスタンス |
|
79 | 80 | */ |
80 | 81 | public static function getInstance() |
81 | 82 | { |
@@ -292,6 +293,7 @@ discard block |
||
292 | 293 | * @param string ログレベル文字列 |
293 | 294 | * @param string 書きだす文字列 |
294 | 295 | * @param string スタックトレース文字列 |
296 | + * @param string $msg |
|
295 | 297 | */ |
296 | 298 | public function write($level, $msg, $context = null) |
297 | 299 | { |
@@ -381,6 +383,8 @@ discard block |
||
381 | 383 | * ローテートを実行する |
382 | 384 | * @param integer 作成日時のUnixTime |
383 | 385 | * @param integer 現在日時のUnixTime |
386 | + * @param integer $from |
|
387 | + * @param integer $to |
|
384 | 388 | */ |
385 | 389 | private function runRotate($from, $to) |
386 | 390 | { |
@@ -450,7 +454,7 @@ discard block |
||
450 | 454 | |
451 | 455 | /** |
452 | 456 | * ログローテートサイズを返却する |
453 | - * @return string ログ出力パス |
|
457 | + * @return integer ログ出力パス |
|
454 | 458 | */ |
455 | 459 | public function getLogRotateSize() |
456 | 460 | { |
@@ -2,7 +2,6 @@ |
||
2 | 2 | namespace WebStream\Log; |
3 | 3 | |
4 | 4 | use WebStream\Module\Utility\FileUtils; |
5 | -use WebStream\Module\Container; |
|
6 | 5 | use WebStream\DI\ServiceLocator; |
7 | 6 | use WebStream\Exception\Extend\LoggerException; |
8 | 7 |
@@ -139,14 +139,14 @@ discard block |
||
139 | 139 | |
140 | 140 | // 設定ファイルが存在するかどうか |
141 | 141 | if ($log === null) { |
142 | - throw new LoggerException("Log config file does not exist: " . $configPath); |
|
142 | + throw new LoggerException("Log config file does not exist: ".$configPath); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | // ログレベル取得 |
146 | 146 | $logLevel = $this->toLogLevelValue($log["level"]); |
147 | 147 | // 妥当なログレベルかどうか |
148 | 148 | if ($logLevel === 0) { |
149 | - throw new LoggerException("Invalid log level: " . $log["level"]); |
|
149 | + throw new LoggerException("Invalid log level: ".$log["level"]); |
|
150 | 150 | } |
151 | 151 | $this->logLevel = $logLevel; |
152 | 152 | |
@@ -155,16 +155,16 @@ discard block |
||
155 | 155 | // 絶対パスでのチェック |
156 | 156 | if (!realpath(dirname($path))) { |
157 | 157 | $container = ServiceLocator::getInstance()->getContainer(); |
158 | - $path = $container->applicationInfo->applicationRoot . "/" . $log["path"]; |
|
158 | + $path = $container->applicationInfo->applicationRoot."/".$log["path"]; |
|
159 | 159 | // プロジェクトルートからの相対パスでのチェック |
160 | 160 | if (!file_exists(dirname($path))) { |
161 | - throw new LoggerException("Log directory does not exist: " . dirname($path)); |
|
161 | + throw new LoggerException("Log directory does not exist: ".dirname($path)); |
|
162 | 162 | } |
163 | 163 | } |
164 | 164 | $this->logPath = $path; |
165 | 165 | |
166 | 166 | // ステータスファイルパスを設定 |
167 | - $this->statusPath = preg_replace_callback('/(.*)\..+/', function ($matches) { |
|
167 | + $this->statusPath = preg_replace_callback('/(.*)\..+/', function($matches) { |
|
168 | 168 | return "$matches[1].status"; |
169 | 169 | }, $this->logPath); |
170 | 170 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $rotateCycle = $this->cycle2value($log["rotate_cycle"]); |
174 | 174 | // 妥当なローテートサイクルか |
175 | 175 | if ($rotateCycle === 0) { |
176 | - throw new LoggerException("Invalid log rotate cycle: " . $log["rotate_cycle"]); |
|
176 | + throw new LoggerException("Invalid log rotate cycle: ".$log["rotate_cycle"]); |
|
177 | 177 | } |
178 | 178 | $this->rotateCycle = $rotateCycle; |
179 | 179 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $rotateSize = intval($log["rotate_size"]); |
184 | 184 | // ローテートサイズが不正の場合(正の整数以外の値が設定された場合) |
185 | 185 | if ($rotateSize <= 0) { |
186 | - throw new LoggerException("Invalid log rotate size: " . $log["rotate_size"]); |
|
186 | + throw new LoggerException("Invalid log rotate size: ".$log["rotate_size"]); |
|
187 | 187 | } |
188 | 188 | $this->rotateSize = $rotateSize; |
189 | 189 | } |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | date_default_timezone_set('Asia/Tokyo'); |
263 | 263 | $msec = sprintf("%2d", floatval(microtime()) * 100); |
264 | 264 | |
265 | - return strftime("%Y-%m-%d %H:%M:%S") . "," . $msec; |
|
265 | + return strftime("%Y-%m-%d %H:%M:%S").",".$msec; |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | /** |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | continue; |
281 | 281 | } |
282 | 282 | $msg .= "\n"; |
283 | - $msg .= "\t#" . trim($stacktraceLine); |
|
283 | + $msg .= "\t#".trim($stacktraceLine); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | return $msg; |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | $content = fread($handle, $size); |
342 | 342 | fclose($handle); |
343 | 343 | if (!preg_match('/^\d{10}$/', $content)) { |
344 | - throw new LoggerException("Invalid log state file contents: " . $content); |
|
344 | + throw new LoggerException("Invalid log state file contents: ".$content); |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | return intval($content); |
@@ -30,6 +30,7 @@ discard block |
||
30 | 30 | /** |
31 | 31 | * コンストラクタ |
32 | 32 | * @param string 設定ファイルパス |
33 | + * @param string $configPath |
|
33 | 34 | */ |
34 | 35 | public function __construct($configPath) |
35 | 36 | { |
@@ -41,7 +42,7 @@ discard block |
||
41 | 42 | * フォーマット済みメッセージを返却する |
42 | 43 | * @param string メッセージ |
43 | 44 | * @param string ログレベル |
44 | - * @return フォーマット済みメッセージ |
|
45 | + * @return string |
|
45 | 46 | */ |
46 | 47 | public function getFormattedMessage($message, $logLevel) |
47 | 48 | { |
@@ -97,6 +98,7 @@ discard block |
||
97 | 98 | * アプリケーション名項目を埋め込む |
98 | 99 | * @param string メッセージ |
99 | 100 | * @param string アプリケーション名 |
101 | + * @param string $message |
|
100 | 102 | * @return 埋め込み済みメッセージ |
101 | 103 | */ |
102 | 104 | private function compileApplicationName($message, $applicationName) |
@@ -113,6 +115,7 @@ discard block |
||
113 | 115 | /** |
114 | 116 | * 日付項目を埋め込む |
115 | 117 | * @param string メッセージ |
118 | + * @param string $message |
|
116 | 119 | * @return 埋め込み済みメッセージ |
117 | 120 | */ |
118 | 121 | private function compileDateTime($message) |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | // メッセージ |
57 | 57 | $formattedMessage = preg_replace('/%m/', $message, $formattedMessage); |
58 | 58 | |
59 | - return $formattedMessage . "\n"; |
|
59 | + return $formattedMessage."\n"; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | // 設定ファイルが存在するかどうか |
71 | 71 | if ($log === null) { |
72 | - throw new LoggerException("Log config file does not exist: " . $configPath); |
|
72 | + throw new LoggerException("Log config file does not exist: ".$configPath); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | // ログアプリケーション名 |
@@ -22,6 +22,7 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * コンストラクタ |
24 | 24 | * @param string キャッシュの保存ディレクトリパス |
25 | + * @param string $savePath |
|
25 | 26 | */ |
26 | 27 | public function __construct($savePath = null) |
27 | 28 | { |
@@ -34,6 +35,7 @@ discard block |
||
34 | 35 | /** |
35 | 36 | * キャッシュを取得する |
36 | 37 | * @param string キャッシュID |
38 | + * @param string $id |
|
37 | 39 | * @return string キャッシュデータ |
38 | 40 | */ |
39 | 41 | public function get($id) |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | { |
41 | 41 | $cache = $this->cache($id); |
42 | 42 | if ($cache !== null) { |
43 | - $path = $this->savePath . "/" . $id . '.cache'; |
|
43 | + $path = $this->savePath."/".$id.'.cache'; |
|
44 | 44 | $cachePath = realpath($path); |
45 | 45 | $this->logger->info("Get cache: ${cachePath}"); |
46 | 46 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | private function cache($id) |
76 | 76 | { |
77 | - $path = $this->savePath . "/" . $id . '.cache'; |
|
77 | + $path = $this->savePath."/".$id.'.cache'; |
|
78 | 78 | $cachePath = realpath($path); |
79 | 79 | if ($cachePath !== false && is_file($cachePath)) { |
80 | 80 | $data = $this->decode(file_get_contents($cachePath)); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | // キャッシュディレクトリが存在するか |
116 | 116 | if (is_dir($this->savePath)) { |
117 | - $cachePath = realpath($this->savePath) . '/' . basename($id) . '.cache'; |
|
117 | + $cachePath = realpath($this->savePath).'/'.basename($id).'.cache'; |
|
118 | 118 | // キャッシュファイルがない場合またはキャッシュファイルが存在するが、 |
119 | 119 | // 上書きする場合はキャッシュを新規作成する |
120 | 120 | if (!is_file($cachePath) || (is_file($cachePath) && $overwrite === true)) { |
@@ -126,11 +126,11 @@ discard block |
||
126 | 126 | |
127 | 127 | return true; |
128 | 128 | } else { // ファイル書き込みに失敗した場合 |
129 | - throw new IOException("Can't create cache: " . $cachePath); |
|
129 | + throw new IOException("Can't create cache: ".$cachePath); |
|
130 | 130 | } |
131 | 131 | } |
132 | 132 | } else { |
133 | - $this->logger->error("Invalid cache directory: " . $this->savePath); |
|
133 | + $this->logger->error("Invalid cache directory: ".$this->savePath); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | return false; |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | */ |
143 | 143 | public function delete($id) |
144 | 144 | { |
145 | - $cachePath = realpath($this->savePath . "/" . $id . '.cache'); |
|
145 | + $cachePath = realpath($this->savePath."/".$id.'.cache'); |
|
146 | 146 | if ($cachePath) { |
147 | 147 | $this->logger->debug("Cache delete success: ${cachePath}"); |
148 | 148 |
@@ -27,6 +27,7 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * クラスをロードする |
29 | 29 | * @param string|array クラス名 |
30 | + * @param string $className |
|
30 | 31 | * @return array<string> ロード済みクラスリスト |
31 | 32 | */ |
32 | 33 | public function load($className) |
@@ -38,6 +39,7 @@ discard block |
||
38 | 39 | * ファイルをインポートする |
39 | 40 | * @param string ファイルパス |
40 | 41 | * @param callable フィルタリング無名関数 trueを返すとインポート |
42 | + * @param string $filepath |
|
41 | 43 | * @return boolean インポート結果 |
42 | 44 | */ |
43 | 45 | public function import($filepath, callable $filter = null) |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace WebStream\Module; |
3 | 3 | |
4 | -require_once dirname(__FILE__) . '/Utility/FileUtils.php'; |
|
5 | -require_once dirname(__FILE__) . '/../DI/Injector.php'; |
|
4 | +require_once dirname(__FILE__).'/Utility/FileUtils.php'; |
|
5 | +require_once dirname(__FILE__).'/../DI/Injector.php'; |
|
6 | 6 | |
7 | 7 | use WebStream\Module\Utility\FileUtils; |
8 | 8 | use WebStream\DI\Injector; |
@@ -43,13 +43,13 @@ discard block |
||
43 | 43 | public function import($filepath, callable $filter = null) |
44 | 44 | { |
45 | 45 | $rootDir = $this->applicationInfo->applicationRoot; |
46 | - $includeFile = $rootDir . "/" . $filepath; |
|
46 | + $includeFile = $rootDir."/".$filepath; |
|
47 | 47 | if (is_file($includeFile)) { |
48 | 48 | $ext = pathinfo($includeFile, PATHINFO_EXTENSION); |
49 | 49 | if ($ext === 'php') { |
50 | 50 | if ($filter === null || (is_callable($filter) && $filter($includeFile) === true)) { |
51 | 51 | include_once $includeFile; |
52 | - $this->logger->debug($includeFile . " import success."); |
|
52 | + $this->logger->debug($includeFile." import success."); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | public function importAll($dirPath, callable $filter = null) |
69 | 69 | { |
70 | 70 | $rootDir = $this->applicationInfo->applicationRoot; |
71 | - $includeDir = realpath($rootDir . "/" . $dirPath); |
|
71 | + $includeDir = realpath($rootDir."/".$dirPath); |
|
72 | 72 | if (is_dir($includeDir)) { |
73 | 73 | $iterator = $this->getFileSearchIterator($includeDir); |
74 | 74 | $isSuccess = true; |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | if ($ext === 'php') { |
82 | 82 | if ($filter === null || (is_callable($filter) && $filter($filepath) === true)) { |
83 | 83 | include_once $filepath; |
84 | - $this->logger->debug($filepath . " import success."); |
|
84 | + $this->logger->debug($filepath." import success."); |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | } else { |
88 | - $this->logger->warn($filepath . " import failure."); |
|
88 | + $this->logger->warn($filepath." import failure."); |
|
89 | 89 | $isSuccess = false; |
90 | 90 | } |
91 | 91 | } |
@@ -111,22 +111,22 @@ discard block |
||
111 | 111 | // まずcoreディレクトリを検索 |
112 | 112 | // coreディレクトリは名前空間とディレクトリパスが |
113 | 113 | // 紐づいているのでそのまま連結して読ませる |
114 | - $includeFile = $rootDir . "/core/" . $className . ".php"; |
|
114 | + $includeFile = $rootDir."/core/".$className.".php"; |
|
115 | 115 | if (is_file($includeFile)) { |
116 | 116 | include_once $includeFile; |
117 | - $this->logger->debug($includeFile . " load success. (search from " . $rootDir . "/core/)"); |
|
117 | + $this->logger->debug($includeFile." load success. (search from ".$rootDir."/core/)"); |
|
118 | 118 | |
119 | 119 | return [$includeFile]; |
120 | 120 | } |
121 | 121 | |
122 | 122 | // さらに見つからなかったらappディレクトリを名前空間付きで全検索し、マッチするもの全てをincludeする |
123 | - $iterator = $this->getFileSearchIterator($rootDir . "/app"); |
|
123 | + $iterator = $this->getFileSearchIterator($rootDir."/app"); |
|
124 | 124 | $includeList = []; |
125 | 125 | foreach ($iterator as $filepath => $fileObject) { |
126 | - if (strpos($filepath, $className . ".php") !== false) { |
|
126 | + if (strpos($filepath, $className.".php") !== false) { |
|
127 | 127 | include_once $filepath; |
128 | 128 | $includeList[] = $filepath; |
129 | - $this->logger->debug($filepath . " load success. (search from " . $rootDir . "/app/)"); |
|
129 | + $this->logger->debug($filepath." load success. (search from ".$rootDir."/app/)"); |
|
130 | 130 | } |
131 | 131 | } |
132 | 132 | if (!empty($includeList)) { |
@@ -139,12 +139,12 @@ discard block |
||
139 | 139 | $classNameWithoutNamespace = $matches[1]; |
140 | 140 | // この処理が走るケースはapp配下のクラスがディレクトリ構成と名前空間が一致していない |
141 | 141 | // 場合以外ない(テスト用クラス除く)ので、app配下の検索を優先する |
142 | - $iterator = $this->getFileSearchIterator($rootDir . "/app"); |
|
142 | + $iterator = $this->getFileSearchIterator($rootDir."/app"); |
|
143 | 143 | foreach ($iterator as $filepath => $fileObject) { |
144 | - if (strpos($filepath, $classNameWithoutNamespace . ".php") !== false) { |
|
144 | + if (strpos($filepath, $classNameWithoutNamespace.".php") !== false) { |
|
145 | 145 | include_once $filepath; |
146 | 146 | $includeList[] = $filepath; |
147 | - $this->logger->debug($filepath . " load success. (full search)"); |
|
147 | + $this->logger->debug($filepath." load success. (full search)"); |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | if (!empty($includeList)) { |
@@ -152,12 +152,12 @@ discard block |
||
152 | 152 | } |
153 | 153 | |
154 | 154 | // ここに到達するのはテスト用クラスのみ |
155 | - $iterator = $this->getFileSearchIterator($rootDir . "/core"); |
|
155 | + $iterator = $this->getFileSearchIterator($rootDir."/core"); |
|
156 | 156 | foreach ($iterator as $filepath => $fileObject) { |
157 | - if (strpos($filepath, $classNameWithoutNamespace . ".php") !== false) { |
|
157 | + if (strpos($filepath, $classNameWithoutNamespace.".php") !== false) { |
|
158 | 158 | include_once $filepath; |
159 | 159 | $includeList[] = $filepath; |
160 | - $this->logger->debug($filepath . " load success. (full search, use in test)"); |
|
160 | + $this->logger->debug($filepath." load success. (full search, use in test)"); |
|
161 | 161 | } |
162 | 162 | } |
163 | 163 | if (!empty($includeList)) { |
@@ -72,8 +72,6 @@ |
||
72 | 72 | |
73 | 73 | /** |
74 | 74 | * キーの値を設定する |
75 | - * @param string $name メソッド名 |
|
76 | - * @param array $arguments 引数リスト |
|
77 | 75 | * @return void |
78 | 76 | */ |
79 | 77 | public function set($key, $value) |
@@ -7,7 +7,6 @@ |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | use WebStream\Module\Security; |
10 | -use WebStream\DI\ServiceLocator; |
|
11 | 10 | use WebStream\Log\Logger; |
12 | 11 | |
13 | 12 | /** |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Functions |
|
4 | - * @author Ryuichi TANAKA. |
|
5 | - * @since 2013/09/04 |
|
6 | - * @version 0.7 |
|
7 | - */ |
|
3 | + * Functions |
|
4 | + * @author Ryuichi TANAKA. |
|
5 | + * @since 2013/09/04 |
|
6 | + * @version 0.7 |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | use WebStream\Module\Security; |
10 | 10 | use WebStream\DI\ServiceLocator; |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | { |
19 | 19 | // ログ処理 |
20 | 20 | if ($error = error_get_last()) { |
21 | - $errorMsg = $error['message'] . " " . $error['file'] . "(" . $error['line'] . ")"; |
|
21 | + $errorMsg = $error['message']." ".$error['file']."(".$error['line'].")"; |
|
22 | 22 | switch ($error['type']) { |
23 | 23 | case E_ERROR: |
24 | 24 | case E_CORE_ERROR: |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | if (!function_exists('safetyOutJSON')) { |
93 | 93 | function safetyOutJSON($data) |
94 | 94 | { |
95 | - return json_encode($data, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT); |
|
95 | + return json_encode($data, JSON_HEX_TAG|JSON_HEX_AMP|JSON_HEX_APOS|JSON_HEX_QUOT); |
|
96 | 96 | } |
97 | 97 | } |
98 | 98 | |
@@ -102,6 +102,6 @@ discard block |
||
102 | 102 | if (!function_exists('safetyOutJSONP')) { |
103 | 103 | function safetyOutJSONP($data, $callback) |
104 | 104 | { |
105 | - return safetyOutJavaScript($callback) . "(" . safetyOutJSON($data) . ");"; |
|
105 | + return safetyOutJavaScript($callback)."(".safetyOutJSON($data).");"; |
|
106 | 106 | } |
107 | 107 | } |