RequestListener   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A onKernelRequest() 0 8 1
1
<?php
2
3
namespace MewesK\TwigExcelBundle\EventListener;
4
5
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
6
7
/**
8
 * Class RequestListener
9
 *
10
 * @package MewesK\TwigExcelBundle\EventListener
11
 */
12
class RequestListener
13
{
14
    /**
15
     * @param GetResponseEvent $event
16
     */
17
    public function onKernelRequest(GetResponseEvent $event)
18
    {
19
        $event->getRequest()->setFormat('csv', 'text/csv');
20
        $event->getRequest()->setFormat('ods', 'application/vnd.oasis.opendocument.spreadsheet');
21
        $event->getRequest()->setFormat('pdf', 'application/pdf');
22
        $event->getRequest()->setFormat('xls', 'application/vnd.ms-excel');
23
        $event->getRequest()->setFormat('xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
24
    }
25
}
26