Completed
Push — master ( a94abc...5691eb )
by Thomas
08:41
created

ActivityCreateAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configureParams() 0 3 1
A run() 0 6 1
1
<?php
2
namespace keeko\core\action;
3
4
use keeko\framework\foundation\AbstractAction;
5
use Symfony\Component\HttpFoundation\Request;
6
use Symfony\Component\HttpFoundation\Response;
7
use Symfony\Component\OptionsResolver\OptionsResolver;
8
use keeko\core\domain\ActivityDomain;
9
10
/**
11
 * Creates an activity
12
 * 
13
 * This code is automatically created. Modifications will probably be overwritten.
14
 * 
15
 * @author gossi
16
 */
17
class ActivityCreateAction extends AbstractAction {
18
19
	/**
20
	 * @param OptionsResolver $resolver
21
	 */
22
	public function configureParams(OptionsResolver $resolver) {
23
		$resolver->setRequired(['id']);
24
	}
25
26
	/**
27
	 * Automatically generated run method
28
	 * 
29
	 * @param Request $request
30
	 * @return Response
31
	 */
32
	public function run(Request $request) {
33
		$id = $this->getParam('id');
34
		$domain = new ActivityDomain($this->getServiceContainer());
35
		$payload = $domain->delete($id);
36
		return $this->responder->run($request, $payload);
37
	}
38
}
39