1 | <?php |
||
17 | class GenericLoggerFactory implements LoggerFactory { |
||
18 | |||
19 | protected $classes; |
||
20 | |||
21 | public function __construct( array $classes = [] ) { |
||
33 | |||
34 | public function create( $config ) { |
||
64 | |||
65 | /** |
||
66 | * Create a logger that outputs to the standard PHP error log. |
||
67 | * @param integer $threshold |
||
68 | * @return Logger |
||
69 | */ |
||
70 | public function createPHPLogger( $threshold = LogLevel::WARNING ) { |
||
74 | |||
75 | /** |
||
76 | * Create a logger that outputs to the specified file. |
||
77 | * @param integer $threshold |
||
78 | * @return Logger |
||
79 | */ |
||
80 | public function createFileLogger( $file, $threshold = LogLevel::WARNING ) { |
||
84 | |||
85 | /** |
||
86 | * Create a logger that outputs to Syslog. |
||
87 | * @param integer $threshold |
||
88 | * @return Logger |
||
89 | */ |
||
90 | public function createSysLogger( $prefix = '', $threshold = LogLevel::WARNING ) { |
||
94 | |||
95 | /** |
||
96 | * Create a logger that outputs to StdOut. |
||
97 | * The StdOut logger is only available when running via the command-line. |
||
98 | * @param integer $threshold |
||
99 | * @return Logger |
||
100 | */ |
||
101 | public function createStdOutLogger( $threshold = LogLevel::WARNING ) { |
||
105 | |||
106 | /** |
||
107 | * Create a logger that outputs to StdErr. |
||
108 | * The StdErr logger is only available when running via the command-line. |
||
109 | * @param integer $threshold |
||
110 | * @return Logger |
||
111 | */ |
||
112 | public function createStdErrLogger( $threshold = LogLevel::WARNING ) { |
||
116 | |||
117 | /** |
||
118 | * Create a logger that performs no output. |
||
119 | * @param integer $threshold |
||
120 | * @return Logger |
||
121 | */ |
||
122 | public function createNullLogger( $threshold = LogLevel::WARNING ) { |
||
126 | |||
127 | /** |
||
128 | * Ensure the configuration is in a consistant format. |
||
129 | * @param array|string $config |
||
130 | * @return array |
||
131 | */ |
||
132 | protected function checkConfig( $config ) { |
||
148 | |||
149 | protected function createLogger( $type, $arg1 = null, $arg2 = null, $arg3 = null ) { |
||
165 | |||
166 | } |
||
167 | |||
168 | // EOF |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.