StdOutStorage   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 5
c 3
b 0
f 1
lcom 0
cbo 0
dl 0
loc 26
ccs 16
cts 16
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A storePacket() 0 12 3
A connect() 0 4 1
A disconnect() 0 4 1
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