CustomsBilling::paid_by()   A
last analyzed

Complexity

Conditions 4
Paths 2

Size

Total Lines 11
Code Lines 7

Duplication

Lines 9
Ratio 81.82 %

Importance

Changes 0
Metric Value
dl 9
loc 11
rs 9.2
c 0
b 0
f 0
cc 4
eloc 7
nc 2
nop 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Ocean
5
 * Date: 8/25/2016
6
 * Time: 11:32 PM.
7
 */
8
9
namespace OceanApplications\Postmen\Models;
10
11
class CustomsBilling extends Billing
12
{
13
    /**
14
     * @param string $value shipper or third_party
15
     *
16
     * @throws \Exception
17
     *
18
     * @return $this
19
     */
20 View Code Duplication
    public function paid_by($value)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
21
    {
22
        if ($value == 'shipper' || $value == 'third_party' || $value == 'recipient') {
23
            $this->paid_by = $value;
24
        } else {
25
            $error = 'Paid by must be shipper or third_party';
26
            throw new \Exception($error);
27
        }
28
29
        return $this;
30
    }
31
}
32