@@ -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 | } |
@@ -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 | } |
@@ -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]; |
@@ -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 @@ |
||
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 |
@@ -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 |
@@ -18,5 +18,5 @@ |
||
18 | 18 | * @param Container 依存コンテナ |
19 | 19 | * @param ReflectionMethod リフレクションメソッドオブジェクト |
20 | 20 | */ |
21 | - public function onMethodInject(IAnnotatable &$instance, Container $container, \ReflectionMethod $method); |
|
21 | + public function onMethodInject(IAnnotatable&$instance, Container $container, \ReflectionMethod $method); |
|
22 | 22 | } |
@@ -183,6 +183,7 @@ |
||
183 | 183 | /** |
184 | 184 | * ログローテートサイクルを時間に変換 |
185 | 185 | * @param string ローテートサイクル |
186 | + * @param string $cycle |
|
186 | 187 | * @return int ローテート時間 |
187 | 188 | */ |
188 | 189 | private function cycle2value($cycle) |
@@ -43,12 +43,12 @@ |
||
43 | 43 | public function load($configPath) |
44 | 44 | { |
45 | 45 | $this->loadConfigFile($configPath) |
46 | - ->loadLogLevel() |
|
47 | - ->loadLogFilePath() |
|
48 | - ->loadRotateCycle() |
|
49 | - ->loadRotateSize() |
|
50 | - ->loadApplicationName() |
|
51 | - ->loadFormat(); |
|
46 | + ->loadLogLevel() |
|
47 | + ->loadLogFilePath() |
|
48 | + ->loadRotateCycle() |
|
49 | + ->loadRotateSize() |
|
50 | + ->loadApplicationName() |
|
51 | + ->loadFormat(); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | { |
70 | 70 | $configMap = $this->parseConfig($configPath); |
71 | 71 | if ($configMap === 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 | $this->configMap = $configMap; |
75 | 75 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | $logLevel = $this->toLogLevelValue($this->configMap["level"]); |
90 | 90 | if ($logLevel === 0) { |
91 | - throw new LoggerException("Invalid log level: " . $this->configMap["level"]); |
|
91 | + throw new LoggerException("Invalid log level: ".$this->configMap["level"]); |
|
92 | 92 | } |
93 | 93 | $this->logContainer->logLevel = $logLevel; |
94 | 94 | |
@@ -105,13 +105,13 @@ discard block |
||
105 | 105 | throw new LoggerException("Log path must be defined."); |
106 | 106 | } |
107 | 107 | |
108 | - $path = $this->getApplicationRoot() . "/" . $this->configMap["path"]; |
|
108 | + $path = $this->getApplicationRoot()."/".$this->configMap["path"]; |
|
109 | 109 | if (!file_exists(dirname($path))) { |
110 | - throw new LoggerException("Log directory does not exist: " . dirname($path)); |
|
110 | + throw new LoggerException("Log directory does not exist: ".dirname($path)); |
|
111 | 111 | } |
112 | 112 | $this->logContainer->logPath = $path; |
113 | 113 | |
114 | - $this->logContainer->statusPath = preg_replace_callback('/(.*)\..+/', function ($matches) { |
|
114 | + $this->logContainer->statusPath = preg_replace_callback('/(.*)\..+/', function($matches) { |
|
115 | 115 | return "$matches[1].status"; |
116 | 116 | }, $this->logContainer->logPath); |
117 | 117 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $rotateCycle = $this->cycle2value($this->configMap["rotate_cycle"]); |
129 | 129 | // 妥当なローテートサイクルか |
130 | 130 | if ($rotateCycle === 0) { |
131 | - throw new LoggerException("Invalid log rotate cycle: " . $this->configMap["rotate_cycle"]); |
|
131 | + throw new LoggerException("Invalid log rotate cycle: ".$this->configMap["rotate_cycle"]); |
|
132 | 132 | } |
133 | 133 | $this->logContainer->rotateCycle = $rotateCycle; |
134 | 134 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $rotateSize = intval($this->configMap["rotate_size"]); |
147 | 147 | // ローテートサイズが不正の場合(正の整数以外の値が設定された場合) |
148 | 148 | if ($rotateSize <= 0) { |
149 | - throw new LoggerException("Invalid log rotate size: " . $this->configMap["rotate_size"]); |
|
149 | + throw new LoggerException("Invalid log rotate size: ".$this->configMap["rotate_size"]); |
|
150 | 150 | } |
151 | 151 | $this->logContainer->rotateSize = $rotateSize; |
152 | 152 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | * フォーマット済みメッセージを返却する |
36 | 36 | * @param string メッセージ |
37 | 37 | * @param string ログレベル |
38 | - * @return フォーマット済みメッセージ |
|
38 | + * @return string |
|
39 | 39 | */ |
40 | 40 | public function getFormattedMessage($message, $logLevel) |
41 | 41 | { |
@@ -49,7 +49,7 @@ |
||
49 | 49 | // メッセージ |
50 | 50 | $formattedMessage = preg_replace('/%m/', $message, $formattedMessage); |
51 | 51 | |
52 | - return $formattedMessage . PHP_EOL; |
|
52 | + return $formattedMessage.PHP_EOL; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |