@@ -120,11 +120,11 @@ |
||
| 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); |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | if (array_key_exists($col, $propertyMap)) { |
| 92 | 92 | $propertyMap[$col]->setValue($instance, $value); |
| 93 | 93 | } else { |
| 94 | - $this->logger->error("Column '$col' is failed mapping in " . $this->classpath); |
|
| 94 | + $this->logger->error("Column '$col' is failed mapping in ".$this->classpath); |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
@@ -31,6 +31,6 @@ |
||
| 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 | } |
@@ -180,8 +180,8 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | // そうでなければ複数回メソッドが実行されるため |
| 85 | 85 | // ただし同一クラス内に限る(親クラスの同一名のメソッドは実行する) |
| 86 | 86 | // TODO ここはテストを追加する |
| 87 | - $classpath = $refMethod->class . "#" . $refMethod->name; |
|
| 87 | + $classpath = $refMethod->class."#".$refMethod->name; |
|
| 88 | 88 | if (!array_key_exists($classpath, $invokeMethods)) { |
| 89 | 89 | $invokeMethods[$classpath] = $refMethod; |
| 90 | 90 | } |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | foreach ($invokeMethods as $classpath => $invokeMethod) { |
| 101 | 101 | $params = ["class" => get_class($this->instance), "method" => $this->method, "exception" => $originException]; |
| 102 | 102 | $invokeMethod->invokeArgs($this->instance, [$params]); |
| 103 | - $this->logger->debug("Execution of handling is success: " . $classpath); |
|
| 103 | + $this->logger->debug("Execution of handling is success: ".$classpath); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | throw $delegateException ?: $originException; |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | if (class_exists($this->classpath)) { |
| 41 | 41 | throw new $this->classpath($this->message); |
| 42 | 42 | } else { |
| 43 | - throw new ClassNotFoundException($this->classpath . " is not found."); |
|
| 43 | + throw new ClassNotFoundException($this->classpath." is not found."); |
|
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -41,8 +41,8 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | $applicationInfo = $this->container->applicationInfo; |
| 43 | 43 | $dirname = $this->camel2snake($this->container->router->pageName); |
| 44 | - $templateDir = $applicationInfo->applicationRoot . "/app/views/" . $dirname; |
|
| 45 | - $sharedDir = $applicationInfo->applicationRoot . "/app/views/" . $applicationInfo->sharedDir; |
|
| 44 | + $templateDir = $applicationInfo->applicationRoot."/app/views/".$dirname; |
|
| 45 | + $sharedDir = $applicationInfo->applicationRoot."/app/views/".$applicationInfo->sharedDir; |
|
| 46 | 46 | |
| 47 | 47 | if (is_dir($templateDir)) { |
| 48 | 48 | $this->loader->addPath($templateDir); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | $escaper = new \Twig_Extension_Escaper(true); |
| 55 | 55 | $twig = new \Twig_Environment($this->loader, [ |
| 56 | - 'cache' => $applicationInfo->applicationRoot . "/app/views/" . $applicationInfo->cacheDir, |
|
| 56 | + 'cache' => $applicationInfo->applicationRoot."/app/views/".$applicationInfo->cacheDir, |
|
| 57 | 57 | 'auto_reload' => true, |
| 58 | 58 | 'debug' => $this->container->debug |
| 59 | 59 | ]); |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | // 制御文字削除 |
| 32 | 32 | $removes = []; |
| 33 | 33 | $removes[] = '/%0[0-8bcef]/'; // 00-08, 11, 12, 14, 15 |
| 34 | - $removes[] = '/%1[0-9a-f]/'; // 16-31 |
|
| 34 | + $removes[] = '/%1[0-9a-f]/'; // 16-31 |
|
| 35 | 35 | $removes[] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S'; // 00-08, 11, 12, 14-31, 127 |
| 36 | 36 | |
| 37 | 37 | // $dataが数行にわたっている場合、一度で置換しきれないので繰り返す |
@@ -74,8 +74,8 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function camel2snake($str) |
| 76 | 76 | { |
| 77 | - $str = preg_replace_callback('/([A-Z])/', function ($matches) { |
|
| 78 | - return '_' . lcfirst($matches[1]); |
|
| 77 | + $str = preg_replace_callback('/([A-Z])/', function($matches) { |
|
| 78 | + return '_'.lcfirst($matches[1]); |
|
| 79 | 79 | }, $str); |
| 80 | 80 | |
| 81 | 81 | return preg_replace('/^_/', '', $str); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function snake2ucamel($str) |
| 90 | 90 | { |
| 91 | - $str = ucfirst(preg_replace_callback('/_([a-zA-Z])/', function ($matches) { |
|
| 91 | + $str = ucfirst(preg_replace_callback('/_([a-zA-Z])/', function($matches) { |
|
| 92 | 92 | return ucfirst($matches[1]); |
| 93 | 93 | }, $str)); |
| 94 | 94 | |