Invite   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A send() 0 4 1
1
<?php
2
3
namespace Helix\Shopify\Customer;
4
5
use Helix\Shopify\Base\Data;
6
use Helix\Shopify\Customer;
7
8
/**
9
 * An invitation email for an existing customer.
10
 *
11
 * @see https://help.shopify.com/en/api/reference/customers/customer#send_invite-2020-04
12
 *
13
 * @method $this    setFrom             (string $from)
14
 * @method $this    setTo               (string $to)
15
 * @method $this    setBcc              (string[] $bcc)
16
 * @method $this    setSubject          (string $subject)
17
 * @method $this    setCustomMessage    (string $message)
18
 * @todo checked
19
 */
20
class Invite extends Data
21
{
22
23
    /**
24
     * @var Customer
25
     */
26
    protected $customer;
27
28
    public function __construct(Customer $customer)
29
    {
30
        $this->customer = $customer;
31
        parent::__construct($customer);
32
    }
33
34
    public function send(): void
35
    {
36
        $this->api->post("{$this->customer}/send_invite", [
37
            'customer_invite' => $this->data
38
        ]);
39
    }
40
}