DefaultController::downloadAction()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 13
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Afsy\Bundle\TutorialBundle\Controller;
4
5
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6
use Symfony\Component\HttpFoundation\Response;
7
8
class DefaultController extends Controller
9
{
10
    /**
11
     *  Download action.
12
     */
13
    public function downloadAction()
14
    {
15
        // Initialize
16
        $pageHoover = $this->container->get('afsy.pagehoover');
17
18
        // Download page
19
        $page = 'http://afsy.fr/';
20
        $pageHoover->downloadPage($page);
21
22
        // Return status
23
        $response = new Response();
24
25
        return $response->setContent('Page "'.$page.'" is downloaded !')->send();
26
    }
27
}
28