Code Duplication    Length = 17-17 lines in 2 locations

src/Packet/Solar/Current.php 1 location

@@ 12-28 (lines=17) @@
9
 *
10
 * @author danieleorler
11
 */
12
class Current extends Base
13
{
14
    function __construct($data = NULL)
15
    {
16
        $this->fields = array
17
        (
18
            'generating'    => NULL,
19
            'exporting'     => NULL,
20
        );
21
        
22
        if(!empty($data))
23
        {
24
            $this->fields['generating'] = new Generating($data['generating']);
25
            $this->fields['exporting'] = new Exporting($data['exporting']);
26
        }
27
    }
28
}
29

src/Packet/Solar/Day.php 1 location

@@ 12-28 (lines=17) @@
9
 *
10
 * @author danieleorler
11
 */
12
class Day extends Base
13
{
14
    function __construct($data = NULL)
15
    {
16
        $this->fields = array
17
        (
18
            'generating'    => NULL,
19
            'exporting'     => NULL,
20
        );
21
        
22
        if(!empty($data))
23
        {
24
            $this->fields['generating'] = new Generating($data['generating']);
25
            $this->fields['exporting'] = new Exporting($data['exporting']);
26
        }
27
    }
28
}
29