GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 262051...7bb052 )
by
unknown
12s
created

DebugExtension::getFunctions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace EightPoints\Bundle\GuzzleBundle\Twig\Extension;
4
5
use Symfony\Component\VarDumper\Cloner\VarCloner;
6
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
7
8
class DebugExtension extends \Twig_Extension
9
{
10
    /**
11
     * @return array
12
     */
13
    public function getFunctions() : array
14
    {
15
        return [
16
            new \Twig_SimpleFunction(
17
                'eight_points_guzzle_dump',
18
                [$this, 'dump'],
19
                ['is_safe' => ['html'], 'needs_environment' => true]
20
            ),
21
        ];
22
    }
23
24
    /**
25
     * @param \Twig_Environment $env
26
     * @param $value
27
     *
28
     * @throws \Exception
29
     *
30
     * @return bool|string
31
     */
32
    public function dump(\Twig_Environment $env, $value)
33
    {
34
        $cloner = new VarCloner();
35
36
        $dump = fopen('php://memory', 'r+b');
37
        $dumper = new HtmlDumper($dump, $env->getCharset());
38
39
        $dumper->dump($cloner->cloneVar($value));
40
        rewind($dump);
0 ignored issues
show
Bug introduced by
It seems like $dump can also be of type false; however, parameter $handle of rewind() does only seem to accept resource, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

40
        rewind(/** @scrutinizer ignore-type */ $dump);
Loading history...
41
42
        return stream_get_contents($dump);
0 ignored issues
show
Bug introduced by
It seems like $dump can also be of type false; however, parameter $handle of stream_get_contents() does only seem to accept resource, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

42
        return stream_get_contents(/** @scrutinizer ignore-type */ $dump);
Loading history...
43
    }
44
}
45