Completed
Push — master ( 8714ce...91124c )
by Thomas
10:30 queued 06:04
created

ApplicationDeleteJsonResponder   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
lcom 0
cbo 3
dl 0
loc 36
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A deleted() 0 3 1
A notDeleted() 0 3 1
A notFound() 0 3 1
A getPayloadMethods() 0 7 1
1
<?php
2
namespace keeko\core\responder;
3
4
use Symfony\Component\HttpFoundation\Request;
5
use Symfony\Component\HttpFoundation\JsonResponse;
6
use keeko\framework\domain\payload\PayloadInterface;
7
use keeko\framework\foundation\AbstractPayloadResponder;
8
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
9
10
/**
11
 * Automatically generated JsonResponder for Deletes an application
12
 * 
13
 * @author gossi
14
 */
15
class ApplicationDeleteJsonResponder extends AbstractPayloadResponder {
16
17
	/**
18
	 * @param Request $request
19
	 * @param PayloadInterface $payload
20
	 */
21
	public function deleted(Request $request, PayloadInterface $payload) {
2 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $payload is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
22
		return new JsonResponse(null, 204);
23
	}
24
25
	/**
26
	 * @param Request $request
27
	 * @param PayloadInterface $payload
28
	 */
29
	public function notDeleted(Request $request, PayloadInterface $payload) {
1 ignored issue
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
30
		return new \Exception($payload->getMessage());
0 ignored issues
show
Bug introduced by
The method getMessage() does not seem to exist on object<keeko\framework\d...yload\PayloadInterface>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
31
	}
32
33
	/**
34
	 * @param Request $request
35
	 * @param PayloadInterface $payload
36
	 */
37
	public function notFound(Request $request, PayloadInterface $payload) {
1 ignored issue
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
38
		throw new ResourceNotFoundException($payload->getMessage());
0 ignored issues
show
Bug introduced by
The method getMessage() does not seem to exist on object<keeko\framework\d...yload\PayloadInterface>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
39
	}
40
41
	/**
42
	 */
43
	protected function getPayloadMethods() {
44
		return [
45
			'keeko\framework\domain\payload\NotFound' => 'notFound',
46
			'keeko\framework\domain\payload\Deleted' => 'deleted',
47
			'keeko\framework\domain\payload\NotDeleted' => 'notDeleted'
48
		];
49
	}
50
}
51