Code Duplication    Length = 9-11 lines in 6 locations

src/Endpoints/Availability/MatchingSlots.php 1 location

@@ 27-36 (lines=10) @@
24
     *
25
     * @return $this
26
     */
27
    public function search(MatchingSlotsSearchParameters $search): self
28
    {
29
        // Set HTTP params
30
        $this->type     = 'post';
31
        $this->endpoint = '/availability/matchingslots' . '?' . $this->getQuery();
32
        $this->params   = $search;
33
        $this->response = MatchingSlotList::class;
34
35
        return $this;
36
    }
37
38
    /**
39
     * Navigate results of a matching slots search

src/Endpoints/Webhooks.php 2 locations

@@ 48-57 (lines=10) @@
45
     *
46
     * @return $this
47
     */
48
    public function create(Webhook $webhook): self
49
    {
50
        // Set HTTP params
51
        $this->type     = 'post';
52
        $this->endpoint = '/webhooks' . '?' . $this->getQuery();
53
        $this->params   = $webhook;
54
        $this->response = Webhook::class;
55
56
        return $this;
57
    }
58
59
    /**
60
     * Retrieve a webhook
@@ 66-76 (lines=11) @@
63
     *
64
     * @return $this
65
     */
66
    public function __invoke(string $webhook_id)
67
    {
68
        $this->webhook_id = $webhook_id;
69
70
        // Set HTTP params
71
        $this->type     = 'get';
72
        $this->endpoint = '/webhooks/' . $webhook_id . '?' . $this->getQuery();
73
        $this->response = Webhook::class;
74
75
        return $this;
76
    }
77
78
    /**
79
     * Delete a webhook

src/Endpoints/Customers.php 3 locations

@@ 44-53 (lines=10) @@
41
     *
42
     * @return $this
43
     */
44
    public function create(Customer $customer): self
45
    {
46
        // Set HTTP params
47
        $this->type     = 'post';
48
        $this->endpoint = '/customers' . '?' . $this->getQuery();
49
        $this->params   = $customer;
50
        $this->response = Customer::class;
51
52
        return $this;
53
    }
54
55
    /**
56
     * Retrieve a customer
@@ 64-74 (lines=11) @@
61
     *
62
     * @return $this
63
     */
64
    public function __invoke(string $customer_id)
65
    {
66
        $this->customer_id = $customer_id;
67
68
        // Set HTTP params
69
        $this->type     = 'get';
70
        $this->endpoint = '/customers/' . $customer_id . '?' . $this->getQuery();
71
        $this->response = Customer::class;
72
73
        return $this;
74
    }
75
76
    /**
77
     * Update an existing customer
@@ 83-91 (lines=9) @@
80
     *
81
     * @return $this
82
     */
83
    public function update(Customer $customer): self
84
    {
85
        // Set HTTP params
86
        $this->type     = 'put';
87
        $this->endpoint = '/customers/' . $this->customer_id . '?' . $this->getQuery();
88
        $this->params   = $customer;
89
90
        return $this;
91
    }
92
93
    /**
94
     * Delete a customer