Completed
Push — master ( eece8c...a3a436 )
by Mr
02:11
created

Settings::taxes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 8
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 8
loc 8
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Bookeo\Endpoints;
4
5
use Bookeo\Client;
6
7
/**
8
 * Access account settings
9
 *
10
 * @package Bookeo\Endpoints
11
 */
12
class Settings extends Client
13
{
14
    /**
15
     * Get information about your own API Key
16
     *
17
     * @return $this
18
     */
19 View Code Duplication
    public function apikeyinfo(): self
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...
20
    {
21
        // Set HTTP params
22
        $this->type     = 'get';
23
        $this->endpoint = '/settings/apikeyinfo' . '?' . $this->getQuery();
24
25
        return $this;
26
    }
27
28
    /**
29
     * Get information, location and contact details about the business
30
     *
31
     * @return $this
32
     */
33 View Code Duplication
    public function business(): self
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...
34
    {
35
        // Set HTTP params
36
        $this->type     = 'get';
37
        $this->endpoint = '/settings/business' . '?' . $this->getQuery();
38
39
        return $this;
40
    }
41
42
    /**
43
     * Retrieve custom fields about customers and participants
44
     *
45
     * @return $this
46
     */
47 View Code Duplication
    public function customercustomfields(): self
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...
48
    {
49
        // Set HTTP params
50
        $this->type     = 'get';
51
        $this->endpoint = '/settings/customercustomfields' . '?' . $this->getQuery();
52
53
        return $this;
54
    }
55
56
    /**
57
     * Retrieve all supported languages
58
     *
59
     * @return $this
60
     */
61 View Code Duplication
    public function languages(): self
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...
62
    {
63
        // Set HTTP params
64
        $this->type     = 'get';
65
        $this->endpoint = '/settings/languages' . '?' . $this->getQuery();
66
67
        return $this;
68
    }
69
70
    /**
71
     * Retrieve all supported people categories
72
     *
73
     * Retrieve the people categories supported by this account.
74
     * This can include the default ones ("Adults","Children","Infants") and also custom ones defined by the account ("Students", ...)
75
     *
76
     * @return $this
77
     */
78 View Code Duplication
    public function peoplecategories(): self
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...
79
    {
80
        // Set HTTP params
81
        $this->type     = 'get';
82
        $this->endpoint = '/settings/peoplecategories' . '?' . $this->getQuery();
83
84
        return $this;
85
    }
86
87
    /**
88
     * Get information about all the products (things that can be booked) offered.
89
     * 3 types of product are available:
90
     * - fixed are products with a fixed schedule and a given number of seats. Ex a group tour, a class, a workshop
91
     * - fixedCourse are fixed products that are defined as a course, i.e. comprise of a series of dates
92
     * - flexibleTime are products that describe private appointments, i.e. when one booking uses one resource (teacher, consultant, etc)
93
     *
94
     * Although Bookeo applies a minimum amount of caching, it is recommended to cache these results for 10-15 minutes to improve the performance of your application, as product settings change rarely.
95
     *
96
     * @return $this
97
     */
98 View Code Duplication
    public function products(): self
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...
99
    {
100
        // Set HTTP params
101
        $this->type     = 'get';
102
        $this->endpoint = '/settings/products' . '?' . $this->getQuery();
103
104
        return $this;
105
    }
106
107
    /**
108
     * Retrieve all available resources
109
     *
110
     * @return $this
111
     */
112 View Code Duplication
    public function resources(): self
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...
113
    {
114
        // Set HTTP params
115
        $this->type     = 'get';
116
        $this->endpoint = '/settings/resources' . '?' . $this->getQuery();
117
118
        return $this;
119
    }
120
121
    /**
122
     * Retrieve all taxes used by this business
123
     *
124
     * @return $this
125
     */
126 View Code Duplication
    public function taxes(): self
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...
127
    {
128
        // Set HTTP params
129
        $this->type     = 'get';
130
        $this->endpoint = '/settings/taxes' . '?' . $this->getQuery();
131
132
        return $this;
133
    }
134
135
}
136