@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public function register(string $name, string $version, Endpoint $endpoint) |
| 24 | 24 | { |
| 25 | - if(!isset($this->endpoints[$version])) { |
|
| 25 | + if (!isset($this->endpoints[$version])) { |
|
| 26 | 26 | $this->endpoints[$version] = []; |
| 27 | 27 | } |
| 28 | 28 | $this->endpoints[$version][strtolower($name)] = $endpoint; |
@@ -37,8 +37,8 @@ discard block |
||
| 37 | 37 | public function getEndpoint(string $name, string $version): Endpoint |
| 38 | 38 | { |
| 39 | 39 | $lowercaseName = strtolower($name); |
| 40 | - if(!isset($this->endpoints[$version]) && !isset($this->endpoints[$version][$lowercaseName])) { |
|
| 41 | - throw new UnknownEndpointException('Could not find endpoint: ' . $name . ' of version: ' . $version); |
|
| 40 | + if (!isset($this->endpoints[$version]) && !isset($this->endpoints[$version][$lowercaseName])) { |
|
| 41 | + throw new UnknownEndpointException('Could not find endpoint: '.$name.' of version: '.$version); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | return $this->endpoints[$version][$lowercaseName]; |
@@ -8,8 +8,7 @@ discard block |
||
| 8 | 8 | * Class RegisteredEndpointFactory |
| 9 | 9 | * @package LunixREST\Endpoint |
| 10 | 10 | */ |
| 11 | -class RegisteredEndpointFactory implements EndpointFactory |
|
| 12 | -{ |
|
| 11 | +class RegisteredEndpointFactory implements EndpointFactory { |
|
| 13 | 12 | /** |
| 14 | 13 | * @var Endpoint[][] |
| 15 | 14 | */ |
@@ -20,8 +19,7 @@ discard block |
||
| 20 | 19 | * @param string $version |
| 21 | 20 | * @param Endpoint $endpoint |
| 22 | 21 | */ |
| 23 | - public function register(string $name, string $version, Endpoint $endpoint) |
|
| 24 | - { |
|
| 22 | + public function register(string $name, string $version, Endpoint $endpoint) { |
|
| 25 | 23 | if(!isset($this->endpoints[$version])) { |
| 26 | 24 | $this->endpoints[$version] = []; |
| 27 | 25 | } |