@@ -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 |
@@ -15,7 +15,7 @@ |
||
15 | 15 | /** |
16 | 16 | * データのバイト長を返却する |
17 | 17 | * @param string 文字列 |
18 | - * @return string バイト長 |
|
18 | + * @return integer バイト長 |
|
19 | 19 | */ |
20 | 20 | public function bytelen($data) |
21 | 21 | { |
@@ -1,8 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace WebStream\Module\Utility; |
3 | 3 | |
4 | -use WebStream\Exception\SystemException; |
|
5 | - |
|
6 | 4 | /** |
7 | 5 | * CommonUtils |
8 | 6 | * 共通のUtility |
@@ -20,7 +20,7 @@ |
||
20 | 20 | public function parseConfig($filepath) |
21 | 21 | { |
22 | 22 | // 正規化した絶対パス |
23 | - $realpath = $this->getApplicationRoot() . DIRECTORY_SEPARATOR . $filepath; |
|
23 | + $realpath = $this->getApplicationRoot().DIRECTORY_SEPARATOR.$filepath; |
|
24 | 24 | |
25 | 25 | return file_exists($realpath) ? parse_ini_file($realpath) : null; |
26 | 26 | } |
@@ -65,7 +65,7 @@ |
||
65 | 65 | public function seek($offset) |
66 | 66 | { |
67 | 67 | if (!array_key_exists($offset, $this->values)) { |
68 | - throw new \OutOfBoundsException("Current cursor is out of range: " . $offset); |
|
68 | + throw new \OutOfBoundsException("Current cursor is out of range: ".$offset); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | return $this->values[$offset]; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | /** |
51 | 51 | * {@inheritdoc} |
52 | 52 | */ |
53 | - public function onClassInject(IAnnotatable &$instance, Container $container, \ReflectionClass $class) |
|
53 | + public function onClassInject(IAnnotatable&$instance, Container $container, \ReflectionClass $class) |
|
54 | 54 | { |
55 | 55 | $this->injectedLog($this); |
56 | 56 | |
@@ -58,13 +58,13 @@ discard block |
||
58 | 58 | $config = $this->annotation->config; |
59 | 59 | |
60 | 60 | if (!class_exists($driver)) { |
61 | - throw new DatabaseException("Database driver is undefined:" . $driver); |
|
61 | + throw new DatabaseException("Database driver is undefined:".$driver); |
|
62 | 62 | } |
63 | 63 | |
64 | - $configPath = $container->applicationInfo->applicationRoot . "/" . $config; |
|
64 | + $configPath = $container->applicationInfo->applicationRoot."/".$config; |
|
65 | 65 | $configRealPath = realpath($configPath); |
66 | 66 | if (!file_exists($configRealPath)) { |
67 | - throw new DatabaseException("Database config file is not found: " . $configPath); |
|
67 | + throw new DatabaseException("Database config file is not found: ".$configPath); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $this->injectedContainer->filepath = $class->getFileName(); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | /** |
80 | 80 | * {@inheritdoc} |
81 | 81 | */ |
82 | - public function onMethodInject(IAnnotatable &$instance, Container $container, \ReflectionMethod $method) |
|
82 | + public function onMethodInject(IAnnotatable&$instance, Container $container, \ReflectionMethod $method) |
|
83 | 83 | { |
84 | 84 | $this->injectedLog($this); |
85 | 85 | |
@@ -94,22 +94,22 @@ discard block |
||
94 | 94 | |
95 | 95 | for ($i = 0; $i < count($allowMethods); $i++) { |
96 | 96 | if (!preg_match("/^(?:(?:P(?:OS|U)|GE)T|(?:p(?:os|u)|ge)t|DELETE|delete)$/", $allowMethods[$i])) { |
97 | - $errorMsg = "Invalid value '" . $allowMethods[$i] . "' in 'allowMethod' attribute of @Header."; |
|
97 | + $errorMsg = "Invalid value '".$allowMethods[$i]."' in 'allowMethod' attribute of @Header."; |
|
98 | 98 | throw new AnnotationException($errorMsg); |
99 | 99 | } |
100 | 100 | $allowMethods[$i] = strtoupper($allowMethods[$i]); |
101 | 101 | } |
102 | 102 | |
103 | 103 | $action = $this->camel2snake($container->router->action); |
104 | - $classpathWithAction = $method->class . "#" . $action; |
|
104 | + $classpathWithAction = $method->class."#".$action; |
|
105 | 105 | |
106 | 106 | // 複数指定した場合、一つでも許可されていればOK |
107 | 107 | if (!$this->inArray($container->request->requestMethod, $allowMethods)) { |
108 | - $errorMsg = "Not allowed request method '" . $container->request->requestMethod . "' in " . $classpathWithAction; |
|
108 | + $errorMsg = "Not allowed request method '".$container->request->requestMethod."' in ".$classpathWithAction; |
|
109 | 109 | throw new InvalidRequestException($errorMsg); |
110 | 110 | } |
111 | 111 | |
112 | - $this->logger->debug("Accepted request method '" . $container->request->requestMethod . "' in " . $classpathWithAction); |
|
112 | + $this->logger->debug("Accepted request method '".$container->request->requestMethod."' in ".$classpathWithAction); |
|
113 | 113 | |
114 | 114 | if ($ext !== null) { |
115 | 115 | $contentType = $this->contentTypeList[$ext]; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $errorMsg = "Invalid value '$ext' in 'contentType' attribute of @Header."; |
118 | 118 | throw new AnnotationException($errorMsg); |
119 | 119 | } |
120 | - $this->logger->debug("Accepted contentType '$ext' in " . $classpathWithAction); |
|
120 | + $this->logger->debug("Accepted contentType '$ext' in ".$classpathWithAction); |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | } |
@@ -50,7 +50,7 @@ |
||
50 | 50 | /** |
51 | 51 | * {@inheritdoc} |
52 | 52 | */ |
53 | - public function onMethodInject(IAnnotatable &$instance, Container $container, \ReflectionMethod $method) |
|
53 | + public function onMethodInject(IAnnotatable&$instance, Container $container, \ReflectionMethod $method) |
|
54 | 54 | { |
55 | 55 | $this->injectedLog($this); |
56 | 56 |
@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace WebStream\Annotation; |
3 | 3 | |
4 | -use WebStream\Core\CoreInterface; |
|
5 | 4 | use WebStream\Annotation\Base\Annotation; |
6 | 5 | use WebStream\Annotation\Base\IAnnotatable; |
7 | 6 | use WebStream\Annotation\Base\IMethod; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @param IAnnotatable アノテーション使用可能インスタンス |
58 | 58 | * @param Container 依存コンテナ |
59 | 59 | */ |
60 | - public function __construct(IAnnotatable &$instance, Container $container) |
|
60 | + public function __construct(IAnnotatable&$instance, Container $container) |
|
61 | 61 | { |
62 | 62 | $this->instance = $instance; |
63 | 63 | $this->container = $container; |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | $annotation->onPropertyInject($this->instance, $this->container, $property); |
253 | 253 | } catch (\Exception $e) { |
254 | 254 | if ($this->exception === null) { |
255 | - $this->exception = function () use ($e) { |
|
255 | + $this->exception = function() use ($e) { |
|
256 | 256 | throw $e; |
257 | 257 | }; |
258 | 258 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | |
40 | 40 | /** |
41 | 41 | * Constructor |
42 | - * @param Container 依存コンテナ |
|
42 | + * @param Container Container |
|
43 | 43 | */ |
44 | 44 | public function __construct(Container $container) |
45 | 45 | { |