Passed
Push — html ( 51e1ba...d230bc )
by Peter
02:59
created

Debug   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
dl 0
loc 12
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A prettyPrint() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Framework\Helper;
6
7
class Debug
8
{
9
    /**
10
     * @param string $str
11
     * @param mixed  $val
12
     * @param mixed  ...$extra
13
     *
14
     * @return string
15
     */
16
    public static function prettyPrint(string $str, $val, ...$extra): string
17
    {
18
        return sprintf($str, print_r($val, true), ...$extra);
1 ignored issue
show
Bug introduced by
It seems like print_r($val, true) can also be of type true; however, parameter $values of sprintf() does only seem to accept double|integer|string, 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

18
        return sprintf($str, /** @scrutinizer ignore-type */ print_r($val, true), ...$extra);
Loading history...
19
    }
20
}
21