ErrorReporting::error503()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
dl 7
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * ErrorReporting
5
 * @copyright Copyright (c) 2011 - 2014 Aleksandr Torosh (http://wezoom.com.ua)
6
 * @author Aleksandr Torosh <[email protected]>
7
 */
8
namespace Application\Mvc\Helper;
9
10
class ErrorReporting extends \Phalcon\Mvc\User\Component
11
{
12
13 View Code Duplication
    public function error404()
14
    {
15
        $response = $this->getDi()->get('response');
0 ignored issues
show
Bug introduced by
The method get cannot be called on $this->getDi() (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
16
        $response->setHeader(404, 'Not Found');
17
        $response->setContent(include __DIR__ . '/../../../Index/views/error/404.phtml');
18
19
    }
20
21 View Code Duplication
    public function error503()
22
    {
23
        $response = $this->getDi()->get('response');
0 ignored issues
show
Bug introduced by
The method get cannot be called on $this->getDi() (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
24
        $response->setHeader(503, 'Service Unavailable');
25
        $response->setContent(include __DIR__ . '/../../../Index/views/error/503.phtml');
26
27
    }
28
29
}
30