HHVMAdapter   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 4
c 1
b 1
f 0
lcom 0
cbo 1
dl 0
loc 24
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A start() 0 4 1
A __construct() 0 6 2
A stop() 0 7 1
1
<?php
2
3
/**
4
 * This file is part of cloak.
5
 *
6
 * (c) Noritaka Horio <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace cloak\analyzer\adapter;
13
14
use cloak\analyzer\AnalyzeAdapter;
15
16
17
/**
18
 * Class HHVMAdapter
19
 * @package cloak\analyzer\adapter
20
 */
21
class HHVMAdapter implements AnalyzeAdapter
22
{
23
24
    public function __construct()
25
    {
26
        if (defined('HHVM_VERSION') === false) {
27
            throw new AdapterNotAvailableException('This adapter requires hhvm');
28
        }
29
    }
30
31
    public function start()
32
    {
33
        fb_enable_code_coverage();
34
    }
35
36
    public function stop()
37
    {
38
        $result = fb_get_code_coverage(true);
39
        fb_disable_code_coverage();
40
41
        return $result;
42
    }
43
44
}
45