Completed
Push — master ( 5895ce...415b34 )
by Thomas
08:36
created

SessionDeleteJsonResponder::deleted()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 2
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 a session
12
 * 
13
 * @author gossi
14
 */
15
class SessionDeleteJsonResponder 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->get('message'));
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->get('message'));
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