@@ -20,7 +20,7 @@ |
||
20 | 20 | * @throws UnknownEndpointException |
21 | 21 | */ |
22 | 22 | public function getEndpoint(string $name, string $version): Endpoint { |
23 | - $className = $this->buildVersionedEndpointNamespace($version) . $name; |
|
23 | + $className = $this->buildVersionedEndpointNamespace($version).$name; |
|
24 | 24 | return new $className($this->entityManager); |
25 | 25 | } |
26 | 26 | } |
@@ -10,12 +10,10 @@ |
||
10 | 10 | * Class DoctrineNamespaceEndpointFactory |
11 | 11 | * @package LunixREST\Endpoint |
12 | 12 | */ |
13 | -class DoctrineNamespaceEndpointFactory extends NamespaceEndpointFactory |
|
14 | -{ |
|
13 | +class DoctrineNamespaceEndpointFactory extends NamespaceEndpointFactory { |
|
15 | 14 | protected $entityManager; |
16 | 15 | |
17 | - public function __construct(string $endpointNamespace, EntityManager $em) |
|
18 | - { |
|
16 | + public function __construct(string $endpointNamespace, EntityManager $em) { |
|
19 | 17 | parent::__construct($endpointNamespace); |
20 | 18 | $this->entityManager = $em; |
21 | 19 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function getEndpoint(string $name, string $version): Endpoint |
27 | 27 | { |
28 | - $className = $this->buildVersionedEndpointNamespace($version) . $name; |
|
28 | + $className = $this->buildVersionedEndpointNamespace($version).$name; |
|
29 | 29 | if (!class_exists($className)) { |
30 | 30 | throw new UnknownEndpointException("Could not find $className"); |
31 | 31 | } |
@@ -54,6 +54,6 @@ discard block |
||
54 | 54 | |
55 | 55 | protected function buildVersionedEndpointNamespace(string $version): string |
56 | 56 | { |
57 | - return $this->endpointNamespace . '\v' . str_replace('.', '_', $version) . '\\'; |
|
57 | + return $this->endpointNamespace.'\v'.str_replace('.', '_', $version).'\\'; |
|
58 | 58 | } |
59 | 59 | } |
@@ -3,8 +3,7 @@ discard block |
||
3 | 3 | |
4 | 4 | use LunixREST\Endpoint\Exceptions\UnknownEndpointException; |
5 | 5 | |
6 | -class NamespaceEndpointFactory implements EndpointFactory |
|
7 | -{ |
|
6 | +class NamespaceEndpointFactory implements EndpointFactory { |
|
8 | 7 | |
9 | 8 | protected $endpointNamespace; |
10 | 9 | |
@@ -12,8 +11,7 @@ discard block |
||
12 | 11 | * NamespaceEndpointFactory constructor. |
13 | 12 | * @param string $endpointNamespace |
14 | 13 | */ |
15 | - public function __construct(string $endpointNamespace) |
|
16 | - { |
|
14 | + public function __construct(string $endpointNamespace) { |
|
17 | 15 | $this->endpointNamespace = $endpointNamespace; |
18 | 16 | } |
19 | 17 |
@@ -3,8 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use LunixREST\Endpoint\Exceptions\UnknownEndpointException; |
5 | 5 | |
6 | -interface EndpointFactory |
|
7 | -{ |
|
6 | +interface EndpointFactory { |
|
8 | 7 | /** |
9 | 8 | * @param string $name |
10 | 9 | * @param string $version |
@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace LunixREST\Endpoint\Exceptions; |
3 | 3 | |
4 | -class UnknownEndpointException extends \Exception |
|
5 | -{ |
|
4 | +class UnknownEndpointException extends \Exception { |
|
6 | 5 | |
7 | 6 | } |
@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace LunixREST\Endpoint\Exceptions; |
3 | 3 | |
4 | -class UnsupportedMethodException extends \Exception |
|
5 | -{ |
|
4 | +class UnsupportedMethodException extends \Exception { |
|
6 | 5 | |
7 | 6 | } |
@@ -8,12 +8,10 @@ |
||
8 | 8 | * Class DoctrineEndpoint |
9 | 9 | * @package LunixREST\Endpoints |
10 | 10 | */ |
11 | -class DoctrineEndpoint extends DefaultEndpoint |
|
12 | -{ |
|
11 | +class DoctrineEndpoint extends DefaultEndpoint { |
|
13 | 12 | protected $entityManager; |
14 | 13 | |
15 | - public function __construct(EntityManager $em) |
|
16 | - { |
|
14 | + public function __construct(EntityManager $em) { |
|
17 | 15 | $this->entityManager = $em; |
18 | 16 | } |
19 | 17 | } |
@@ -9,8 +9,7 @@ |
||
9 | 9 | * Class Endpoint |
10 | 10 | * @package LunixREST\Endpoints |
11 | 11 | */ |
12 | -class DefaultEndpoint implements Endpoint |
|
13 | -{ |
|
12 | +class DefaultEndpoint implements Endpoint { |
|
14 | 13 | /** |
15 | 14 | * @param Request $request |
16 | 15 | * @return ResponseData |
@@ -9,8 +9,7 @@ |
||
9 | 9 | * Interface Endpoint |
10 | 10 | * @package LunixREST\Endpoints |
11 | 11 | */ |
12 | -interface Endpoint |
|
13 | -{ |
|
12 | +interface Endpoint { |
|
14 | 13 | /** |
15 | 14 | * @param Request $request |
16 | 15 | * @return ResponseData |
@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace LunixREST\Exceptions; |
3 | 3 | |
4 | -class InstanceNotFoundException extends \Exception |
|
5 | -{ |
|
4 | +class InstanceNotFoundException extends \Exception { |
|
6 | 5 | |
7 | 6 | } |