Day::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 7

Duplication

Lines 14
Ratio 100 %

Code Coverage

Tests 10
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 14
loc 14
ccs 10
cts 10
cp 1
rs 9.4285
cc 2
eloc 7
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Dalen\OWLPacketInterceptor\Packet\Solar;
4
5
use Dalen\OWLPacketInterceptor\Packet\Base;
6
7
/**
8
 * Description of Day
9
 *
10
 * @author danieleorler
11
 */
12 View Code Duplication
class Day extends Base
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14 8
    function __construct($data = NULL)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
15
    {
16 8
        $this->fields = array
17
        (
18 8
            'generating'    => NULL,
19 8
            'exporting'     => NULL,
20
        );
21
        
22 8
        if(!empty($data))
23 8
        {
24 8
            $this->fields['generating'] = new Generating($data['generating']);
25 8
            $this->fields['exporting'] = new Exporting($data['exporting']);
26 8
        }
27 8
    }
28
}
29