GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Customer::invoiceDeliveredByEmail()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 0
cts 2
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Speicher210\Monsum\Api\Model;
4
5
/**
6
 * Customer model.
7
 */
8
class Customer
9
{
10
    use CustomerTrait;
11
12
    const CUSTOMER_SALUTATION_NONE = '';
13
    const CUSTOMER_SALUTATION_MR = 'mr';
14
    const CUSTOMER_SALUTATION_MRS = 'mrs';
15
    const CUSTOMER_SALUTATION_FAMILY = 'family';
16
17
    const CUSTOMER_PAYMENT_TYPE_TRANSFER = 1;
18
    const CUSTOMER_PAYMENT_TYPE_DIRECT_DEBIT = 2;
19
    const CUSTOMER_PAYMENT_TYPE_CASH = 3;
20
    const CUSTOMER_PAYMENT_TYPE_PAYPAL = 4;
21
    const CUSTOMER_PAYMENT_TYPE_ADVANCED_PAYMENT = 5;
22
    const CUSTOMER_PAYMENT_TYPE_CREDIT_CARD = 6;
23
24
    const CUSTOMER_TYPE_BUSINESS = 'business';
25
    const CUSTOMER_TYPE_CONSUMER = 'consumer';
26
27
    const INVOICE_DELIVERY_METHOD_NONE = 'none';
28
    const INVOICE_DELIVERY_METHOD_MAIL = 'mail';
29
    const INVOICE_DELIVERY_METHOD_POST = 'post';
30
    const INVOICE_DELIVERY_METHOD_BOTH = 'both';
31
32
    /**
33
     * Check if the user is a consumer.
34
     *
35
     * @return boolean
36
     */
37
    public function isConsumer()
38
    {
39
        return $this->customerType === self::CUSTOMER_TYPE_CONSUMER;
40
    }
41
42
    /**
43
     * Check if the user is a business.
44
     *
45
     * @return boolean
46
     */
47
    public function isBusiness()
48
    {
49
        return $this->customerType === self::CUSTOMER_TYPE_BUSINESS;
50
    }
51
52
    /**
53
     * Check if the invoice is delivered by email (only by email or also by email).
54
     *
55
     * @return boolean
56
     */
57
    public function invoiceDeliveredByEmail()
58
    {
59
        return in_array(
60
            $this->invoiceDeliveryMethod,
61
            [
62
                self::INVOICE_DELIVERY_METHOD_MAIL,
63
                self::INVOICE_DELIVERY_METHOD_BOTH
64
            ],
65
            true
66
        );
67
    }
68
}
69