HHVMAdapter::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 2
eloc 3
c 1
b 1
f 0
nc 2
nop 0
dl 0
loc 6
rs 9.4285
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