Completed
Push — master ( 5cd95a...6f73c5 )
by Oscar
03:28
created

DeleteEntity   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 5
dl 0
loc 11
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A html() 0 8 1
1
<?php
2
3
namespace Folk\Controllers;
4
5
use Psr\Http\Message\ServerRequestInterface as Request;
6
use Psr\Http\Message\ResponseInterface as Response;
7
use Folk\Admin;
8
use Folk\Entities\EntityInterface;
9
use Zend\Diactoros\Response\RedirectResponse;
10
11
class DeleteEntity extends Entity
12
{
13
    public function html(Request $request, Response $response, Admin $app, EntityInterface $entity)
0 ignored issues
show
Unused Code introduced by
The parameter $response 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...
14
    {
15
        $entity->delete($request->getAttribute('id'));
16
17
        return new RedirectResponse($app->getRoute('search', [
18
            'entity' => $entity->getName(),
19
        ]));
20
    }
21
}
22