Completed
Push — master ( 78109b...eb9bf0 )
by Sergey
03:40
created
src/Api/Endpoints/Endpoint.php 1 patch
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -6,93 +6,93 @@
 block discarded – undo
6 6
 
7 7
 class Endpoint
8 8
 {
9
-    /**
10
-     * @var array
11
-     */
12
-    protected $allowedMethods = [
13
-        'getById',
14
-        'getAll',
15
-        'create',
16
-        'update',
17
-        'delete',
18
-    ];
9
+	/**
10
+	 * @var array
11
+	 */
12
+	protected $allowedMethods = [
13
+		'getById',
14
+		'getAll',
15
+		'create',
16
+		'update',
17
+		'delete',
18
+	];
19 19
 
20
-    /**
21
-     * @var string
22
-     */
23
-    protected $endpoint;
20
+	/**
21
+	 * @var string
22
+	 */
23
+	protected $endpoint;
24 24
 
25
-    /**
26
-     * @var array
27
-     */
28
-    protected $headers = [];
25
+	/**
26
+	 * @var array
27
+	 */
28
+	protected $headers = [];
29 29
 
30
-    /**
31
-     * @var HttpInterface
32
-     */
33
-    protected $http;
30
+	/**
31
+	 * @var HttpInterface
32
+	 */
33
+	protected $http;
34 34
 
35
-    /**
36
-     * @param HttpInterface $http
37
-     */
38
-    public function __construct(HttpInterface $http)
39
-    {
40
-        $this->http = $http;
41
-    }
35
+	/**
36
+	 * @param HttpInterface $http
37
+	 */
38
+	public function __construct(HttpInterface $http)
39
+	{
40
+		$this->http = $http;
41
+	}
42 42
 
43
-    /**
44
-     * @param string $verb
45
-     * @return string
46
-     */
47
-    public function makeRequestUrl($verb = '')
48
-    {
49
-        return "https://favro.com/api/v1/{$this->endpoint}/$verb";
50
-    }
43
+	/**
44
+	 * @param string $verb
45
+	 * @return string
46
+	 */
47
+	public function makeRequestUrl($verb = '')
48
+	{
49
+		return "https://favro.com/api/v1/{$this->endpoint}/$verb";
50
+	}
51 51
 
52
-    /**
53
-     * @param string $method
54
-     * @return bool
55
-     */
56
-    public function isMethodAllowed($method)
57
-    {
58
-        return in_array($method, $this->allowedMethods);
59
-    }
52
+	/**
53
+	 * @param string $method
54
+	 * @return bool
55
+	 */
56
+	public function isMethodAllowed($method)
57
+	{
58
+		return in_array($method, $this->allowedMethods);
59
+	}
60 60
 
61
-    /**
62
-     * @return HttpInterface
63
-     */
64
-    public function getHttp()
65
-    {
66
-        return $this->http;
67
-    }
61
+	/**
62
+	 * @return HttpInterface
63
+	 */
64
+	public function getHttp()
65
+	{
66
+		return $this->http;
67
+	}
68 68
 
69
-    /**
70
-     * @param array $params
71
-     * @return array
72
-     */
73
-    public function getAll(array $params = [])
74
-    {
75
-        return $this->getHttp()->get(
76
-            $this->makeRequestUrl(), $params, $this->getHeaders()
77
-        );
78
-    }
69
+	/**
70
+	 * @param array $params
71
+	 * @return array
72
+	 */
73
+	public function getAll(array $params = [])
74
+	{
75
+		return $this->getHttp()->get(
76
+			$this->makeRequestUrl(), $params, $this->getHeaders()
77
+		);
78
+	}
79 79
 
80
-    /**
81
-     * @param string $id
82
-     * @return array
83
-     */
84
-    public function getById($id)
85
-    {
86
-        return $this->getHttp()->get(
87
-            $this->makeRequestUrl($id), [], $this->getHeaders()
88
-        );
89
-    }
80
+	/**
81
+	 * @param string $id
82
+	 * @return array
83
+	 */
84
+	public function getById($id)
85
+	{
86
+		return $this->getHttp()->get(
87
+			$this->makeRequestUrl($id), [], $this->getHeaders()
88
+		);
89
+	}
90 90
 
91
-    /**
92
-     * @return array
93
-     */
94
-    protected function getHeaders()
95
-    {
96
-        return $this->headers;
97
-    }
91
+	/**
92
+	 * @return array
93
+	 */
94
+	protected function getHeaders()
95
+	{
96
+		return $this->headers;
97
+	}
98 98
 }
99 99
\ No newline at end of file
Please login to merge, or discard this patch.