Yolo::isHandling()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Monolol\Lolifiers;
4
5
use Monolol\Lolifier;
6
use Monolog\Logger;
7
8
class Yolo implements Lolifier
9
{
10
    private
11
        $acceptedLevels;
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $acceptedLevels.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
12
        
13 10
    public function __construct()
14
    {
15 10
        $this->acceptedLevels = array(
16 10
            Logger::DEBUG,
17 10
            Logger::INFO,
18
        );
19 10
    }    
20
        
21 8
    public function isHandling(array $record)
22
    {
23 8
        return in_array($record['level'], $this->acceptedLevels);
24
    }
25
    
26 1
    public function lolify(array $record)
27
    {
28 1
        return $record;
29
    }
30
}
31
32