Completed
Push — master ( 415b34...7ef068 )
by Thomas
13:10 queued 06:22
created

ActivityDeleteAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
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
 * Action Class for activity-delete
12
 * 
13
 * This code is automatically created. Modifications will probably be overwritten.
14
 */
15
class ActivityDeleteAction extends AbstractAction {
16
17
	/**
18
	 * @param OptionsResolver $resolver
19
	 */
20
	public function configureParams(OptionsResolver $resolver) {
21
		$resolver->setRequired(['id']);
22
	}
23
24
	/**
25
	 * Automatically generated run method
26
	 * 
27
	 * @param Request $request
28
	 * @return Response
29
	 */
30
	public function run(Request $request) {
31
		$id = $this->getParam('id');
32
		$domain = new ActivityDomain($this->getServiceContainer());
33
		$payload = $domain->delete($id);
34
		return $this->response->run($request, $payload);
0 ignored issues
show
Bug introduced by
The property response does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
35
	}
36
}
37