@@ -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) |
@@ -68,11 +68,11 @@ |
||
| 68 | 68 | public function load() |
| 69 | 69 | { |
| 70 | 70 | $this->loadLogLevel() |
| 71 | - ->loadLogFilePath() |
|
| 72 | - ->loadRotateCycle() |
|
| 73 | - ->loadRotateSize() |
|
| 74 | - ->loadApplicationName() |
|
| 75 | - ->loadFormat(); |
|
| 71 | + ->loadLogFilePath() |
|
| 72 | + ->loadRotateCycle() |
|
| 73 | + ->loadRotateSize() |
|
| 74 | + ->loadApplicationName() |
|
| 75 | + ->loadFormat(); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | } else { |
| 46 | 46 | $configMap = $this->parseConfig($config); |
| 47 | 47 | if ($configMap === null) { |
| 48 | - throw new LoggerException("Log config file does not exist: " . $config); |
|
| 48 | + throw new LoggerException("Log config file does not exist: ".$config); |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | $this->ioContainer = new Container(); |
| 54 | 54 | |
| 55 | 55 | $rootDir = $this->getApplicationRoot(); |
| 56 | - $this->ioContainer->file = function () use ($rootDir, $configMap) { |
|
| 56 | + $this->ioContainer->file = function() use ($rootDir, $configMap) { |
|
| 57 | 57 | if (!array_key_exists("path", $configMap)) { |
| 58 | 58 | throw new LoggerException("Log path must be defined."); |
| 59 | 59 | } |
| 60 | - return new File($rootDir . "/" . $configMap["path"]); |
|
| 60 | + return new File($rootDir."/".$configMap["path"]); |
|
| 61 | 61 | }; |
| 62 | 62 | |
| 63 | 63 | $this->configMap = $configMap; |
@@ -110,11 +110,11 @@ discard block |
||
| 110 | 110 | { |
| 111 | 111 | $file = $this->ioContainer->file; |
| 112 | 112 | if (!($file->exists() && $file->isFile())) { |
| 113 | - throw new LoggerException("Log directory does not exist: " . $file->getFilePath()); |
|
| 113 | + throw new LoggerException("Log directory does not exist: ".$file->getFilePath()); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | $this->logContainer->logPath = $file->getFilePath(); |
| 117 | - $this->logContainer->statusPath = preg_replace_callback('/(.*)\..+/', function ($matches) { |
|
| 117 | + $this->logContainer->statusPath = preg_replace_callback('/(.*)\..+/', function($matches) { |
|
| 118 | 118 | return "$matches[1].status"; |
| 119 | 119 | }, $this->logContainer->logPath); |
| 120 | 120 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $rotateSize = intval($this->configMap["rotate_size"]); |
| 145 | 145 | // ローテートサイズが不正の場合(正の整数以外の値が設定された場合) |
| 146 | 146 | if ($rotateSize <= 0) { |
| 147 | - throw new LoggerException("Invalid log rotate size: " . $this->configMap["rotate_size"]); |
|
| 147 | + throw new LoggerException("Invalid log rotate size: ".$this->configMap["rotate_size"]); |
|
| 148 | 148 | } |
| 149 | 149 | $this->logContainer->rotateSize = $rotateSize; |
| 150 | 150 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | case 'year': |
| 207 | 207 | return $year_to_h; |
| 208 | 208 | default: |
| 209 | - throw new LoggerException("Invalid log rotate cycle: " . $cycle); |
|
| 209 | + throw new LoggerException("Invalid log rotate cycle: ".$cycle); |
|
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 | } |
@@ -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 | /** |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | { |
| 33 | 33 | $sapi = php_sapi_name(); |
| 34 | 34 | if (array_key_exists($sapi, $this->sapis) && $this->sapis[$sapi] === 'http') { |
| 35 | - echo $text . "<br>"; |
|
| 35 | + echo $text."<br>"; |
|
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | } |