Completed
Push — master ( 2da503...38628d )
by Shinji
14s queued 11s
created

CallFrame::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 4
nc 1
nop 4
dl 0
loc 10
rs 10
c 1
b 0
f 1
1
<?php
2
3
/**
4
 * This file is part of the sj-i/php-profiler package.
5
 *
6
 * (c) sji <[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
declare(strict_types=1);
13
14
namespace PhpProfiler\Lib\PhpProcessReader;
15
16
use PhpProfiler\Lib\PhpInternals\Types\Zend\Opline;
17
18
/** @psalm-immutable */
19
final class CallFrame
20
{
21
    public string $class_name;
22
    public string $function_name;
23
    public string $file_name;
24
    public ?Opline $opline;
25
26
    public function __construct(
27
        string $class_name,
28
        string $function_name,
29
        string $file_name,
30
        ?Opline $opline
31
    ) {
32
        $this->class_name = $class_name;
33
        $this->function_name = $function_name;
34
        $this->file_name = $file_name;
35
        $this->opline = $opline;
36
    }
37
38
    public function getFullyQualifiedFunctionName(): string
39
    {
40
        if ($this->class_name === '') {
41
            return $this->function_name;
42
        }
43
        return "{$this->class_name}::{$this->function_name}";
44
    }
45
}
46