Completed
Push — master ( 396080...e991d3 )
by Théo
04:21
created

Psysh   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 27.27%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 26
ccs 3
cts 11
cp 0.2727
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 4 1
A debug() 0 8 1
A getInstance() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the PsyshBundle package.
5
 *
6
 * (c) Théo FIDRY <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Fidry\PsyshBundle\DependencyInjection;
13
14
use Psy\Shell;
15
16
/**
17
 * @author Théo FIDRY <[email protected]>
18
 */
19
final class Psysh
20
{
21
    /**
22
     * @var Shell
23
     */
24
    private static $shell;
25
26 6
    public static function init(Shell $shell)
27
    {
28 6
        self::$shell = $shell;
29 6
    }
30
31
    public static function debug(array $variables = [], $bind = null)
32
    {
33
        $_variables = array_merge(self::$shell->getScopeVariables(), $variables);
34
35
        extract(
36
            self::$shell->debug($_variables, $bind)
0 ignored issues
show
Bug introduced by
self::$shell->debug($_variables, $bind) cannot be passed to extract() as the parameter $var_array expects a reference.
Loading history...
37
        );
38
    }
39
40
    public static function getInstance()
41
    {
42
        return self::$shell;
43
    }
44
}
45