Completed
Pull Request — master (#21)
by Théo
04:20 queued 01:09
created

Psysh::debug()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 8
rs 9.4285
cc 1
eloc 4
nc 1
nop 2
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
    public static function init(Shell $shell)
27
    {
28
        self::$shell = $shell;
29
    }
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