Code Duplication    Length = 26-26 lines in 2 locations

WebStream/Log/LoggerConfigurationManager.php 1 location

@@ 218-243 (lines=26) @@
215
     * @throws LoggerException
216
     * @return int ログレベル数値
217
     */
218
    private function toLogLevelValue(string $level)
219
    {
220
        switch (strtolower($level)) {
221
            case 'debug':
222
                return 1;
223
            case 'info':
224
                return 2;
225
            case 'notice':    // PSR-3
226
                return 3;
227
            case 'warn':
228
            case 'warning':   // PSR-3
229
                return 4;
230
            case 'error':
231
                return 5;
232
            case 'critical':  // PSR-3
233
                return 6;
234
            case 'alert':     // PSR-3
235
                return 7;
236
            case 'emergency': // PSR-3
237
                return 8;
238
            case 'fatal':
239
                return 9;
240
            default:
241
                throw new LoggerException("Undefined log level: $level");
242
        }
243
    }
244
}
245

WebStream/Log/LoggerUtils.php 1 location

@@ 60-85 (lines=26) @@
57
     * @throws LoggerException
58
     * @return int ログレベル数値
59
     */
60
    public function toLogLevelValue(string $level)
61
    {
62
        switch (strtolower($level)) {
63
            case 'debug':
64
                return 1;
65
            case 'info':
66
                return 2;
67
            case 'notice':    // PSR-3
68
                return 3;
69
            case 'warn':
70
            case 'warning':   // PSR-3
71
                return 4;
72
            case 'error':
73
                return 5;
74
            case 'critical':  // PSR-3
75
                return 6;
76
            case 'alert':     // PSR-3
77
                return 7;
78
            case 'emergency': // PSR-3
79
                return 8;
80
            case 'fatal':
81
                return 9;
82
            default:
83
                throw new LoggerException("Undefined log level: $level");
84
        }
85
    }
86
}
87