GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

WrapperLogger::info()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * Copyright (c) Enalean, 2014. All Rights Reserved.
4
 *
5
 * This file is a part of Tuleap.
6
 *
7
 * Tuleap is free software; you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation; either version 2 of the License, or
10
 * (at your option) any later version.
11
 *
12
 * Tuleap is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License
18
 * along with Tuleap. If not, see <http://www.gnu.org/licenses/>.
19
 */
20
21
class WrapperLogger implements Logger {
22
23
    /**
24
     * @var Logger
25
     */
26
    private $logger;
27
28
    private $prefix = array();
29
30
    public function __construct(Logger $logger, $prefix) {
31
        $this->logger   = $logger;
32
        $this->prefix[] = $prefix;
33
    }
34
35
    public function debug($message) {
36
        $this->logger->debug($this->formatMessage($message));
37
    }
38
39
    public function error($message, Exception $exception = null) {
40
        $this->logger->error($this->formatMessage($message), $exception);
41
    }
42
43
    public function info($message) {
44
        $this->logger->info($this->formatMessage($message));
45
    }
46
47
    public function log($message, $level = null) {
48
        $this->logger->log($this->formatMessage($message), $level);
0 ignored issues
show
Deprecated Code introduced by
The method Logger::log() has been deprecated with message: use explicit methods

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
49
    }
50
51
    public function warn($message, Exception $exception = null) {
52
        $this->logger->warn($this->formatMessage($message), $exception);
53
    }
54
55
    private function formatMessage($message) {
56
        return '['.implode($this->prefix, '][').'] '.$message;
57
    }
58
59
    public function push($prefix) {
60
        $this->prefix[] = $prefix;
61
    }
62
63
    public function pop() {
64
        array_pop($this->prefix);
65
    }
66
}
67