Completed
Push — master ( 5d5ac8...e1864c )
by
unknown
17:03
created

SiteAccessCollector::collect()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 6
rs 9.4285
1
<?php
2
3
/**
4
 * This file is part of the eZ Publish Kernel package.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 */
9
namespace eZ\Bundle\EzPublishDebugBundle\Collector;
10
11
use eZ\Publish\Core\MVC\Symfony\SiteAccess;
12
use Symfony\Component\HttpFoundation\Request;
13
use Symfony\Component\HttpFoundation\Response;
14
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
15
16
/**
17
 * Data collector showing siteaccess.
18
 */
19
class SiteAccessCollector extends DataCollector
20
{
21
    public function collect(Request $request, Response $response, \Exception $exception = null)
22
    {
23
        $this->data = [
24
            'siteAccess' => $request->attributes->get('siteaccess'),
25
        ];
26
    }
27
28
    public function getName()
29
    {
30
        return 'ezpublish.debug.siteaccess';
31
    }
32
33
    /**
34
     * Returns siteAccess.
35
     *
36
     * @return SiteAccess
37
     */
38
    public function getSiteAccess()
39
    {
40
        return $this->data['siteAccess'];
41
    }
42
}
43