Completed
Push — master ( e96b7c...7ab255 )
by Vladimir
03:16
created

TviMonitorBundle::boot()   A

Complexity

Conditions 4
Paths 3

Size

Total Lines 17
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 8.7414

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 17
ccs 3
cts 9
cp 0.3333
rs 9.9332
c 0
b 0
f 0
cc 4
crap 8.7414
nc 3
nop 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A error_clear_last() 0 10 2
1
<?php
2
/**
3
 * This file is part of the `tvi/monitor-bundle` project.
4
 *
5
 * (c) https://github.com/turnaev/monitor-bundle/graphs/contributors
6
 *
7
 * For the full copyright and license information, please view the LICENSE.md
8
 * file that was distributed with this source code.
9
 */
0 ignored issues
show
Coding Style introduced by
PHP version not specified
Loading history...
Coding Style introduced by
Missing @category tag in file comment
Loading history...
Coding Style introduced by
Missing @package tag in file comment
Loading history...
Coding Style introduced by
Missing @author tag in file comment
Loading history...
Coding Style introduced by
Missing @license tag in file comment
Loading history...
Coding Style introduced by
Missing @link tag in file comment
Loading history...
10
11
namespace Tvi\MonitorBundle;
12
13
use Symfony\Component\DependencyInjection\ContainerBuilder;
14
use Symfony\Component\HttpKernel\Bundle\Bundle;
15
use Tvi\MonitorBundle\DependencyInjection\Compiler\AddChecksCompilerPass;
16
17
/**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
18
 * @author Vladimir Turnaev <[email protected]>
19
 */
0 ignored issues
show
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @link tag in class comment
Loading history...
20
class TviMonitorBundle extends Bundle
21
{
22 9
    public function boot()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function boot()
Loading history...
23
    {
24 9
        parent::boot();
25
        # HHVM compatibility hack
0 ignored issues
show
Coding Style introduced by
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Loading history...
26 9
        if (defined('HHVM_VERSION')) {
27
28
            if (!\function_exists('error_clear_last')) {
29
                function error_clear_last()
0 ignored issues
show
Coding Style introduced by
Method name "TviMonitorBundle::error_clear_last" is not in camel caps format
Loading history...
Coding Style introduced by
Missing doc comment for function error_clear_last()
Loading history...
30
                {
31
                    \set_error_handler(function () {});
0 ignored issues
show
Coding Style introduced by
Closing brace must be on a line by itself
Loading history...
32
                    try {
33
                        \trigger_error('');
34
                    } catch (\Exception $e) {
35
                        \restore_error_handler();
36
                        throw $e;
37
                    }
38
                    \restore_error_handler();
39
                }
40
            }
41
        }
42 9
    }
43
44
    public function build(ContainerBuilder $container)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function build()
Loading history...
45
    {
46
        $container->addCompilerPass(new AddChecksCompilerPass());
47
    }
48
}
49