Completed
Push — master ( d6a6e9...1d4c8e )
by Thomas
10:31
created

SessionUserReadAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configureParams() 0 3 1
A run() 0 7 1
1
<?php
2
namespace keeko\core\action;
3
4
use keeko\framework\foundation\AbstractAction;
5
use Symfony\Component\OptionsResolver\OptionsResolver;
6
use Symfony\Component\HttpFoundation\Request;
7
use Symfony\Component\HttpFoundation\Response;
8
use keeko\core\model\SessionQuery;
9
10
/**
11
 */
12
class SessionUserReadAction extends AbstractAction {
13
14
	/**
15
	 * @param OptionsResolver $resolver
16
	 */
17
	public function configureParams(OptionsResolver $resolver) {
18
		$resolver->setRequired(['id']);
19
	}
20
21
	/**
22
	 * Automatically generated run method
23
	 * 
24
	 * @param Request $request
25
	 * @return Response
26
	 */
27
	public function run(Request $request) {
28
		$id = $this->getParam('id');
29
		$session = SessionQuery::create()->findOneById($id);
30
31
		// run response
32
		return $this->response->run($request, $session);
33
	}
34
}
35