MediaController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 17
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A faviconAction() 0 9 1
1
<?php
2
/**
3
 * AnimeDb package.
4
 *
5
 * @author    Peter Gribanov <[email protected]>
6
 * @copyright Copyright (c) 2011, Peter Gribanov
7
 * @license   http://opensource.org/licenses/GPL-3.0 GPL v3
8
 */
9
namespace AnimeDb\Bundle\AppBundle\Controller;
10
11
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
12
use Symfony\Component\HttpFoundation\Response;
13
use AnimeDb\Bundle\AppBundle\Service\Downloader;
14
15
class MediaController extends Controller
16
{
17
    /**
18
     * @param string $host
19
     *
20
     * @return Response
21
     */
22
    public function faviconAction($host)
23
    {
24
        $response = new Response();
25
        $response->headers->set('Content-Type', Downloader::FAVICON_MIME);
26
27
        $filename = $this->get('anime_db.downloader')->favicon($host);
28
29
        return $response->setContent(file_get_contents($filename));
30
    }
31
}
32