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 ( 14690e...e9eac8 )
by Brent
02:11 queued 01:06
created

ImmutableDataTransferObject   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 25
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Spatie\DataTransferObject;
4
5
class ImmutableDataTransferObject
6
{
7
    protected DataTransferObject $dataTransferObject;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
8
9
    public function __construct(DataTransferObject $dataTransferObject)
10
    {
11
        foreach (get_object_vars($dataTransferObject) as $k => $v) {
12
            if (is_subclass_of($v, DataTransferObject::class)) {
13
                $dataTransferObject->{$k} = new self($v);
14
            };
15
        }
16
        $this->dataTransferObject = $dataTransferObject;
17
    }
18
19
    public function __set($name, $value)
20
    {
21
        throw DataTransferObjectError::immutable($name);
22
    }
23
24
    public function __get($name)
25
    {
26
        return $this->dataTransferObject->{$name};
27
    }
28
29
    public function __call($name, $arguments)
30
    {
31
        return call_user_func_array([$this->dataTransferObject, $name], $arguments);
32
    }
33
}
34