Completed
Push — feature/0.7.0 ( 385c73...df772f )
by Ryuichi
03:38
created
WebStream/Exception/ApplicationException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
             $exception = $this;
27 27
         }
28 28
 
29
-        Logger::error(get_class($exception) . " is thrown: " . $exception->getFile() . "(" . $exception->getLine() . ")");
29
+        Logger::error(get_class($exception)." is thrown: ".$exception->getFile()."(".$exception->getLine().")");
30 30
         if (!empty($message)) {
31 31
             Logger::error($this->getMessage(), $this->getTraceAsString());
32 32
         }
Please login to merge, or discard this patch.
WebStream/Core/CoreView.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -120,11 +120,11 @@
 block discarded – undo
120 120
     final public function __file($filepath)
121 121
     {
122 122
         $publicDir = $this->container->applicationInfo->publicDir;
123
-        if (preg_match('/\/views\/' . $publicDir . '\/img\/.+\.(?:jp(?:e|)g|png|bmp|(?:tif|gi)f)$/i', $filepath) ||
124
-            preg_match('/\/views\/' . $publicDir . '\/css\/.+\.css$/i', $filepath) ||
125
-            preg_match('/\/views\/' . $publicDir . '\/js\/.+\.js$/i', $filepath)) { // 画像,css,jsの場合
123
+        if (preg_match('/\/views\/'.$publicDir.'\/img\/.+\.(?:jp(?:e|)g|png|bmp|(?:tif|gi)f)$/i', $filepath) ||
124
+            preg_match('/\/views\/'.$publicDir.'\/css\/.+\.css$/i', $filepath) ||
125
+            preg_match('/\/views\/'.$publicDir.'\/js\/.+\.js$/i', $filepath)) { // 画像,css,jsの場合
126 126
             $this->display($filepath);
127
-        } elseif (preg_match('/\/views\/' . $publicDir . '\/file\/.+$/i', $filepath)) { // それ以外のファイル
127
+        } elseif (preg_match('/\/views\/'.$publicDir.'\/file\/.+$/i', $filepath)) { // それ以外のファイル
128 128
             $this->download($filepath);
129 129
         } else { // 全てのファイル
130 130
             $this->display($filepath);
Please login to merge, or discard this patch.
WebStream/Http/Response.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -155,11 +155,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
WebStream/Database/ConnectionManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,14 +77,14 @@
 block discarded – undo
77 77
             $dsnHash = "";
78 78
             $databaseConfigContainer = new Container(false);
79 79
             foreach ($config as $key => $value) {
80
-                $dsnHash .= $key . $value;
80
+                $dsnHash .= $key.$value;
81 81
                 $databaseConfigContainer->set($key, $value);
82 82
             }
83 83
             $dsnHash = md5($dsnHash);
84 84
 
85 85
             $this->classpathMap[$container->filepath] = $dsnHash;
86 86
 
87
-            $this->connectionContainer->{$dsnHash} = function () use ($driverClassPath, $databaseConfigContainer, $logger) {
87
+            $this->connectionContainer->{$dsnHash} = function() use ($driverClassPath, $databaseConfigContainer, $logger) {
88 88
                 $driver = new $driverClassPath($databaseConfigContainer);
89 89
                 $driver->inject('logger', $logger);
90 90
 
Please login to merge, or discard this patch.
WebStream/Database/Query.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -120,9 +120,9 @@
 block discarded – undo
120 120
         try {
121 121
             $stmt = $this->driver->getStatement($this->sql);
122 122
             if ($stmt === false) {
123
-                throw new DatabaseException("Can't create statement: ". $this->sql);
123
+                throw new DatabaseException("Can't create statement: ".$this->sql);
124 124
             }
125
-            $this->logger->info("Executed SQL: " . $this->sql);
125
+            $this->logger->info("Executed SQL: ".$this->sql);
126 126
             foreach ($this->bind as $key => $value) {
127 127
                 $this->logger->info("Bind statement: $key => $value");
128 128
                 if (preg_match("/^[0-9]+$/", $value) && is_int($value)) {
Please login to merge, or discard this patch.
WebStream/Database/Driver/Sqlite.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,6 +31,6 @@
 block discarded – undo
31 31
         ]);
32 32
 
33 33
         $this->connection = DriverManager::getConnection($params, $config);
34
-        $this->logger->debug(get_class($this) . " connect.");
34
+        $this->logger->debug(get_class($this)." connect.");
35 35
     }
36 36
 }
Please login to merge, or discard this patch.
WebStream/Delegate/CoreExecuteDelegator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
 
181 181
         // テンプレートキャッシュチェック
182 182
         $pageName = $this->container->coreDelegator->getPageName();
183
-        $cacheFile = $applicationInfo->cachePrefix . $this->camel2snake($pageName) . "-" . $this->camel2snake($method);
184
-        $cache = new Cache($applicationInfo->applicationRoot . "/app/views/" . $applicationInfo->cacheDir);
183
+        $cacheFile = $applicationInfo->cachePrefix.$this->camel2snake($pageName)."-".$this->camel2snake($method);
184
+        $cache = new Cache($applicationInfo->applicationRoot."/app/views/".$applicationInfo->cacheDir);
185 185
         $cache->inject('logger', $this->logger);
186 186
         $data = $cache->get($cacheFile);
187 187
 
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
             ]);
249 249
 
250 250
             if ($template->cacheTime !== null) {
251
-                $cacheFile = $applicationInfo->cachePrefix . $this->camel2snake($pageName) . "-" . $this->camel2snake($method);
251
+                $cacheFile = $applicationInfo->cachePrefix.$this->camel2snake($pageName)."-".$this->camel2snake($method);
252 252
                 $view->templateCache($cacheFile, ob_get_contents(), $template->cacheTime);
253 253
             }
254 254
 
Please login to merge, or discard this patch.
WebStream/Delegate/AnnotationDelegatorFactory.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             unset($injectedAnnotation[$annotationKey]);
104 104
         }
105 105
 
106
-        return function () use ($injectedAnnotation) {
106
+        return function() use ($injectedAnnotation) {
107 107
             return $injectedAnnotation;
108 108
         };
109 109
     }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
      */
116 116
     private function createHeader($containerList)
117 117
     {
118
-        return function () use ($containerList) {
118
+        return function() use ($containerList) {
119 119
             $headerContainer = new Container();
120 120
             $headerContainer->mimeType = "html";
121 121
             if ($containerList !== null) {
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
      */
134 134
     private function createFilter($containerList)
135 135
     {
136
-        return function () use ($containerList) {
136
+        return function() use ($containerList) {
137 137
             $filterListContainer = new Container();
138 138
             $filterListContainer->initialize = new AnnotationListContainer();
139 139
             $filterListContainer->before     = new AnnotationListContainer();
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
                 // アクションメソッドの@Filter(type="skip")をチェックする
146 146
                 // 1メソッドに対して複数の@Filterが指定されてもエラーにはしない
147 147
                 foreach ($containerList as $filterAnnotation) {
148
-                    if ($filterAnnotation->classpath . "#" . $filterAnnotation->action === $filterAnnotation->method->class . "#" . $filterAnnotation->method->name) {
148
+                    if ($filterAnnotation->classpath."#".$filterAnnotation->action === $filterAnnotation->method->class."#".$filterAnnotation->method->name) {
149 149
                         if ($filterAnnotation->annotation->type === 'skip') {
150 150
                             $exceptMethods = $filterAnnotation->annotation->except;
151 151
                             if (!is_array($exceptMethods)) {
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
      */
218 218
     private function createTemplate($containerList)
219 219
     {
220
-        return function () use ($containerList) {
220
+        return function() use ($containerList) {
221 221
             $templateContainer = new Container(false);
222 222
             $templateContainer->engine = $containerList !== null ? $containerList[0]->engine : null;
223 223
             $templateContainer->cacheTime = $containerList !== null ? $containerList[0]->cacheTime : null;
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
      */
234 234
     private function createExceptionHandler($containerList)
235 235
     {
236
-        return function () use ($containerList) {
236
+        return function() use ($containerList) {
237 237
             return $containerList === null ? [] : $containerList;
238 238
         };
239 239
     }
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
      */
246 246
     private function createDatabase($containerList)
247 247
     {
248
-        return function () use ($containerList) {
248
+        return function() use ($containerList) {
249 249
             return $containerList;
250 250
         };
251 251
     }
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
      */
258 258
     private function createQuery($containerList)
259 259
     {
260
-        return function () use ($containerList) {
260
+        return function() use ($containerList) {
261 261
             return $containerList;
262 262
         };
263 263
     }
@@ -269,8 +269,8 @@  discard block
 block discarded – undo
269 269
      */
270 270
     private function createAlias($containerList)
271 271
     {
272
-        return function () use ($containerList) {
273
-            return $containerList === null ? [] : $containerList;;
272
+        return function() use ($containerList) {
273
+            return $containerList === null ? [] : $containerList; ;
274 274
         };
275 275
     }
276 276
 }
Please login to merge, or discard this patch.
WebStream/Delegate/AnnotationDelegator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
     public function read($instance, $method = null, $classpath = null)
60 60
     {
61 61
         if (!$instance instanceof IAnnotatable) {
62
-            $this->logger->warn("Annotation is not available this class: " . get_class($instance));
62
+            $this->logger->warn("Annotation is not available this class: ".get_class($instance));
63 63
             return;
64 64
         }
65 65
 
Please login to merge, or discard this patch.