ErrorLogAdmin   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
eloc 27
c 4
b 0
f 0
dl 0
loc 52
ccs 0
cts 33
cp 0
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A configureRoutes() 0 3 1
A configureListFields() 0 15 1
A configureShowFields() 0 10 1
1
<?php
2
/**
3
 * @author Gerard van Helden <[email protected]>
4
 * @copyright Zicht Online <http://zicht.nl>
5
 */
6
7
namespace Zicht\Bundle\UrlBundle\Admin;
8
9
use Sonata\AdminBundle\Datagrid\ListMapper;
10
use Sonata\AdminBundle\Route\RouteCollection;
11
use Sonata\AdminBundle\Show\ShowMapper;
12
use Sonata\AdminBundle\Admin\Admin;
13
14
/**
15
 * Admin for error logs.
16
 *
17
 */
18
class ErrorLogAdmin extends Admin
0 ignored issues
show
Deprecated Code introduced by
The class Sonata\AdminBundle\Admin\Admin has been deprecated: since version 3.1, to be removed in 4.0. Use Sonata\AdminBundle\AbstractAdmin instead ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

18
class ErrorLogAdmin extends /** @scrutinizer ignore-deprecated */ Admin
Loading history...
19
{
20
    protected $datagridValues = array(
21
        '_page'         => 1,
22
        '_sort_order'   => 'DESC',
23
        '_sort_by'      => 'date_created'
24
    );
25
26
    /**
27
     * @{inheritDoc}
28
     */
29
    public function configureListFields(ListMapper $listMapper)
30
    {
31
        $listMapper
32
            ->addIdentifier('date_created', null, array('route' => array('name' => 'show')))
33
            ->add('status')
34
            ->add('url')
35
            ->add('ip')
36
            ->add('message')
37
            ->add(
38
                '_action',
39
                'actions',
40
                array(
41
                    'actions' => array(
42
                        'show' => array(),
43
                        'delete' => array()
44
                    )
45
                )
46
            );
47
    }
48
49
    /**
50
     * @{inheritDoc}
51
     */
52
    protected function configureShowFields(ShowMapper $show)
53
    {
54
        $show
55
            ->add('date_created')
56
            ->add('status')
57
            ->add('url')
58
            ->add('ip')
59
            ->add('referer')
60
            ->add('ua')
61
            ->add('message');
62
    }
63
64
    /**
65
     * @{inheritdoc}
66
     */
67
    protected function configureRoutes(RouteCollection $collection)
68
    {
69
        $collection->remove('create');
70
    }
71
}
72