ZvalU2::__get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 3
rs 10
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\PhpInternals\Types\Zend;
15
16
use FFI\CData;
17
18
class ZvalU2
19
{
20
    /** @psalm-suppress PropertyNotSetInConstructor */
21
    public int $next;
22
    /** @psalm-suppress PropertyNotSetInConstructor */
23
    public int $opline_num;
24
    /** @psalm-suppress PropertyNotSetInConstructor */
25
    public int $lineno;
26
    /** @psalm-suppress PropertyNotSetInConstructor */
27
    public int $num_args;
28
    /** @psalm-suppress PropertyNotSetInConstructor */
29
    public int $fe_pos;
30
    /** @psalm-suppress PropertyNotSetInConstructor */
31
    public int $fe_iter_idx;
32
    /** @psalm-suppress PropertyNotSetInConstructor */
33
    public int $access_flags;
34
    /** @psalm-suppress PropertyNotSetInConstructor */
35
    public int $property_guard;
36
    /** @psalm-suppress PropertyNotSetInConstructor */
37
    public int $constant_flags;
38
    /** @psalm-suppress PropertyNotSetInConstructor */
39
    public int $extra;
40
41
    public function __construct(
42
        private CData $cdata
43
    ) {
44
        unset($this->next);
45
        unset($this->opline_num);
46
        unset($this->lineno);
47
        unset($this->num_args);
48
        unset($this->fe_pos);
49
        unset($this->fe_iter_idx);
50
        unset($this->access_flags);
51
        unset($this->property_guard);
52
        unset($this->constant_flags);
53
        unset($this->extra);
54
    }
55
56
    public function __get(string $field_name): mixed
57
    {
58
        return $this->cdata->$field_name;
59
    }
60
}
61