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 ( d5d00d...5dc9a6 )
by Freek
03:05
created

Backtrace::getArgumentHash()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 1
nop 0
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Spatie\Once;
4
5
class Backtrace
6
{
7
    /** @var array */
8
    public $trace;
9
10
    public function __construct(array $trace)
11
    {
12
        $this->trace = $trace;
13
    }
14
15
    public function getArguments(): array
16
    {
17
        return $this->trace['args'];
18
    }
19
20
    public function getFunctionName(): string
21
    {
22
        return $this->trace['function'];
23
    }
24
25
    /**
26
     * @return mixed
27
     */
28
    public function getObject()
29
    {
30
        return $this->trace['object'];
31
    }
32
33
    public function getArgumentHash(): string
34
    {
35
        $normalizedArguments = array_map(function ($argument) {
36
            return is_object($argument) ? spl_object_hash($argument) : $argument;
37
        }, $this->getArguments());
38
39
        return md5(serialize($normalizedArguments));
40
    }
41
}
42