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

ReadEntity   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A html() 0 14 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
10
class ReadEntity extends Entity
11
{
12
    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...
13
    {
14
        $id = $request->getAttribute('id');
15
16
        $form = static::createForm($entity, $app, $id);
17
        $form['data']->val($entity->read($id));
18
19
        //Render template
20
        return $app['templates']->render('pages/read', [
21
            'entity' => $entity,
22
            'form' => $form,
23
            'id' => $id,
24
        ]);
25
    }
26
}
27