@@ -7,8 +7,7 @@ |
||
7 | 7 | * Interface AccessControl |
8 | 8 | * @package LunixREST\AccessControl |
9 | 9 | */ |
10 | -interface AccessControl |
|
11 | -{ |
|
10 | +interface AccessControl { |
|
12 | 11 | /** |
13 | 12 | * Validates if a given request should be able to access what it's trying to |
14 | 13 | * @param $request |
@@ -6,8 +6,7 @@ discard block |
||
6 | 6 | use LunixREST\Request\Request; |
7 | 7 | use LunixREST\Response\ResponseData; |
8 | 8 | |
9 | -class PhoneNumbers extends DefaultEndpoint |
|
10 | -{ |
|
9 | +class PhoneNumbers extends DefaultEndpoint { |
|
11 | 10 | |
12 | 11 | protected $geoPhone; |
13 | 12 | |
@@ -15,8 +14,7 @@ discard block |
||
15 | 14 | * PhoneNumbers constructor. |
16 | 15 | * @param GeoPhone $geoPhone |
17 | 16 | */ |
18 | - public function __construct(GeoPhone $geoPhone) |
|
19 | - { |
|
17 | + public function __construct(GeoPhone $geoPhone) { |
|
20 | 18 | $this->geoPhone = $geoPhone; |
21 | 19 | } |
22 | 20 |
@@ -6,13 +6,11 @@ |
||
6 | 6 | use LunixREST\Endpoint\Endpoint; |
7 | 7 | use LunixREST\Endpoint\Exceptions\UnknownEndpointException; |
8 | 8 | |
9 | -class EndpointFactory implements \LunixREST\Endpoint\EndpointFactory |
|
10 | -{ |
|
9 | +class EndpointFactory implements \LunixREST\Endpoint\EndpointFactory { |
|
11 | 10 | |
12 | 11 | protected $geoPhone; |
13 | 12 | |
14 | - public function __construct(GeoPhone $geoPhone) |
|
15 | - { |
|
13 | + public function __construct(GeoPhone $geoPhone) { |
|
16 | 14 | $this->geoPhone = $geoPhone; |
17 | 15 | } |
18 | 16 |
@@ -7,8 +7,7 @@ discard block |
||
7 | 7 | * Class GeoPhone |
8 | 8 | * @package GeoPhone\Models |
9 | 9 | */ |
10 | -class LookupResponse implements ResponseData |
|
11 | -{ |
|
10 | +class LookupResponse implements ResponseData { |
|
12 | 11 | protected $city; |
13 | 12 | protected $state; |
14 | 13 | |
@@ -17,8 +16,7 @@ discard block |
||
17 | 16 | * @param string $city |
18 | 17 | * @param string $state |
19 | 18 | */ |
20 | - public function __construct(string $city, string $state) |
|
21 | - { |
|
19 | + public function __construct(string $city, string $state) { |
|
22 | 20 | $this->city = $city; |
23 | 21 | $this->state = $state; |
24 | 22 | } |
@@ -5,8 +5,7 @@ discard block |
||
5 | 5 | * Class GeoPhone |
6 | 6 | * @package GeoPhone\Models |
7 | 7 | */ |
8 | -class GeoPhone |
|
9 | -{ |
|
8 | +class GeoPhone { |
|
10 | 9 | /** |
11 | 10 | * @var resource |
12 | 11 | */ |
@@ -15,8 +14,7 @@ discard block |
||
15 | 14 | /** |
16 | 15 | * @param string $filename |
17 | 16 | */ |
18 | - public function __construct($filename = 'data.csv') |
|
19 | - { |
|
17 | + public function __construct($filename = 'data.csv') { |
|
20 | 18 | $this->fileHandle = fopen($filename, 'r'); |
21 | 19 | } |
22 | 20 |
@@ -6,8 +6,7 @@ |
||
6 | 6 | use LunixREST\Request\Request; |
7 | 7 | use LunixREST\Response\ResponseData; |
8 | 8 | |
9 | -class helloworld extends DefaultEndpoint |
|
10 | -{ |
|
9 | +class helloworld extends DefaultEndpoint { |
|
11 | 10 | |
12 | 11 | /** |
13 | 12 | * @param Request $request |
@@ -3,8 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use LunixREST\Response\ResponseData; |
5 | 5 | |
6 | -class HelloWorld implements ResponseData |
|
7 | -{ |
|
6 | +class HelloWorld implements ResponseData { |
|
8 | 7 | |
9 | 8 | protected $helloWorld = "HelloWorld"; |
10 | 9 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | /** |
14 | 14 | * JSONRequestData constructor. |
15 | - * @param $body |
|
15 | + * @param string $body |
|
16 | 16 | * @throws InvalidRequestDataException |
17 | 17 | */ |
18 | 18 | public function __construct($body) |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | /** |
49 | 49 | * Attempts to find a specific key in the parsed data. Returns true if found else false |
50 | 50 | * @param string $key |
51 | - * @return mixed |
|
51 | + * @return boolean |
|
52 | 52 | */ |
53 | 53 | public function has(string $key): bool |
54 | 54 | { |
@@ -3,8 +3,7 @@ discard block |
||
3 | 3 | |
4 | 4 | use LunixREST\Request\BodyParser\Exceptions\InvalidRequestDataException; |
5 | 5 | |
6 | -class JSONRequestData implements RequestData |
|
7 | -{ |
|
6 | +class JSONRequestData implements RequestData { |
|
8 | 7 | |
9 | 8 | protected $jsonString; |
10 | 9 | |
@@ -15,8 +14,7 @@ discard block |
||
15 | 14 | * @param $body |
16 | 15 | * @throws InvalidRequestDataException |
17 | 16 | */ |
18 | - public function __construct($body) |
|
19 | - { |
|
17 | + public function __construct($body) { |
|
20 | 18 | $this->jsonString = $body; |
21 | 19 | $this->parsedData = json_decode($body, true); |
22 | 20 | if ($this->parsedData === null) { |
@@ -40,8 +38,7 @@ discard block |
||
40 | 38 | * @param string $key |
41 | 39 | * @return mixed |
42 | 40 | */ |
43 | - public function get(string $key) |
|
44 | - { |
|
41 | + public function get(string $key) { |
|
45 | 42 | return $this->parsedData[$key] ?? null; |
46 | 43 | } |
47 | 44 |
@@ -8,14 +8,12 @@ discard block |
||
8 | 8 | * Class PublicAccessControl |
9 | 9 | * @package LunixREST\AccessControl |
10 | 10 | */ |
11 | -class PublicAccessControl implements AccessControl |
|
12 | -{ |
|
11 | +class PublicAccessControl implements AccessControl { |
|
13 | 12 | /** |
14 | 13 | * @param \LunixREST\APIRequest\APIRequest $request |
15 | 14 | * @return bool |
16 | 15 | */ |
17 | - public function validateAccess(APIRequest $request) |
|
18 | - { |
|
16 | + public function validateAccess(APIRequest $request) { |
|
19 | 17 | return true; |
20 | 18 | } |
21 | 19 | |
@@ -23,8 +21,7 @@ discard block |
||
23 | 21 | * @param $apiKey |
24 | 22 | * @return bool |
25 | 23 | */ |
26 | - public function validateKey($apiKey) |
|
27 | - { |
|
24 | + public function validateKey($apiKey) { |
|
28 | 25 | return true; |
29 | 26 | } |
30 | 27 | } |