Completed
Push — master ( b1e789...396080 )
by Théo
11s
created

Psysh::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 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