Coupon   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 22
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setCode() 0 5 1
A setCouponSheet() 0 5 1
A fromArray() 0 6 1
1
<?php
2
namespace Germania\Coupons;
3
4
class Coupon extends CouponAbstract implements CouponInterface
5
{
6
7 10
    public function setCode( $code )
8
    {
9 10
        $this->code = $code;
10 10
        return $this;
11
    }
12
13 10
    public function setCouponSheet( CouponSheetInterface $coupon_sheet )
14
    {
15 10
        $this->coupon_sheet = $coupon_sheet;
16 10
        return $this;
17
    }
18
19 15
   public static function fromArray( array $array) {
20 15
       $instance = new self();
21 15
       $instance->code         = $array['code'];
22 15
       $instance->coupon_sheet = $array['coupon_sheet'];
23 15
       return $instance;
24
   }
25
}
26