StdOutStorage::storePacket()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
ccs 10
cts 10
cp 1
rs 9.4285
cc 3
eloc 5
nc 4
nop 1
crap 3
1
<?php
2
3
namespace Dalen\OWLPacketInterceptor\Storage;
4
5
use Dalen\OWLPacketInterceptor\Packet\IPacket;
6
7
/**
8
 * Description of StdOutStorage
9
 *
10
 * @author danieleorler
11
 */
12
class StdOutStorage implements IStorage
13
{
14 2
    public function storePacket(IPacket $packet)
15
    {
16 2
        if($packet instanceof \Dalen\OWLPacketInterceptor\Packet\Solar\Solar)
17 2
        {
18 1
            echo("This is a Solar Packet");
19 1
        }
20
        
21 2
        if($packet instanceof \Dalen\OWLPacketInterceptor\Packet\Electricity\Electricity)
22 2
        {
23 1
            echo("This is an Electricity Packet");
24 1
        }
25 2
    }
26
27 1
    public function connect()
28
    {
29 1
        echo("StdOut Storage connected!");
30 1
    }
31
32 1
    public function disconnect()
33
    {
34 1
        echo("StdOut Storage disconnected!");
35 1
    }
36
37
}
38