ZendReferenceMemoryLocation   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 9
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromZendReference() 0 7 1
1
<?php
2
3
/**
4
 * This file is part of the reliforp/reli-prof 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 Reli\Lib\PhpProcessReader\PhpMemoryReader\MemoryLocation;
15
16
use Reli\Lib\PhpInternals\Types\Zend\ZendReference;
17
18
class ZendReferenceMemoryLocation extends RefcountedMemoryLocation
19
{
20
    public static function fromZendReference(ZendReference $zend_reference): self
21
    {
22
        return new self(
23
            $zend_reference->getPointer()->address,
24
            $zend_reference->getPointer()->size,
25
            $zend_reference->gc->refcount,
26
            $zend_reference->gc->type_info,
27
        );
28
    }
29
}
30