Coupon::setCode()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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