Completed
Push — feature/0.7.0 ( 17fb54...5bdbd1 )
by Ryuichi
04:00
created
WebStream/Log/LoggerConfigurationManager.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         } else {
44 44
             $configMap = $this->parseConfig($config);
45 45
             if ($configMap === null) {
46
-                throw new LoggerException("Log config file does not exist: " . $config);
46
+                throw new LoggerException("Log config file does not exist: ".$config);
47 47
             }
48 48
         }
49 49
 
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
         $this->ioContainer = new Container();
52 52
 
53 53
         $rootDir = $this->getApplicationRoot();
54
-        $this->ioContainer->file = function () use ($rootDir, $configMap) {
54
+        $this->ioContainer->file = function() use ($rootDir, $configMap) {
55 55
             if (!array_key_exists("path", $configMap)) {
56 56
                 throw new LoggerException("Log path must be defined.");
57 57
             }
58
-            return new File($rootDir . "/" . $configMap["path"]);
58
+            return new File($rootDir."/".$configMap["path"]);
59 59
         };
60 60
 
61 61
         $this->configMap = $configMap;
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
         $logLevel = $this->toLogLevelValue($this->configMap["level"]);
98 98
         if ($logLevel === 0) {
99
-            throw new LoggerException("Invalid log level: " . $this->configMap["level"]);
99
+            throw new LoggerException("Invalid log level: ".$this->configMap["level"]);
100 100
         }
101 101
         $this->logContainer->logLevel = $logLevel;
102 102
 
@@ -111,11 +111,11 @@  discard block
 block discarded – undo
111 111
     {
112 112
         $file = $this->ioContainer->file;
113 113
         if (!($file->exists() && $file->isFile())) {
114
-            throw new LoggerException("Log directory does not exist: " . $file->getFilePath());
114
+            throw new LoggerException("Log directory does not exist: ".$file->getFilePath());
115 115
         }
116 116
 
117 117
         $this->logContainer->logPath = $file->getFilePath();
118
-        $this->logContainer->statusPath = preg_replace_callback('/(.*)\..+/', function ($matches) {
118
+        $this->logContainer->statusPath = preg_replace_callback('/(.*)\..+/', function($matches) {
119 119
             return "$matches[1].status";
120 120
         }, $this->logContainer->logPath);
121 121
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
             $rotateCycle = $this->cycle2value($this->configMap["rotate_cycle"]);
133 133
             // 妥当なローテートサイクルか
134 134
             if ($rotateCycle === 0) {
135
-                throw new LoggerException("Invalid log rotate cycle: " . $this->configMap["rotate_cycle"]);
135
+                throw new LoggerException("Invalid log rotate cycle: ".$this->configMap["rotate_cycle"]);
136 136
             }
137 137
             $this->logContainer->rotateCycle = $rotateCycle;
138 138
         }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
             $rotateSize = intval($this->configMap["rotate_size"]);
151 151
             // ローテートサイズが不正の場合(正の整数以外の値が設定された場合)
152 152
             if ($rotateSize <= 0) {
153
-                throw new LoggerException("Invalid log rotate size: " . $this->configMap["rotate_size"]);
153
+                throw new LoggerException("Invalid log rotate size: ".$this->configMap["rotate_size"]);
154 154
             }
155 155
             $this->logContainer->rotateSize = $rotateSize;
156 156
         }
Please login to merge, or discard this patch.