Issues (26)

docs/examples/People.php (1 issue)

Labels
Severity
1
<?php
2
3
use JSONAPI\Resource\Attributes as JSONAPI;
4
5
#[JSONAPI\Resource('people')]
6
class People
7
{
8
    public function __construct(
9
        protected int $id,
0 ignored issues
show
A parse error occurred: Syntax error, unexpected T_PROTECTED, expecting T_VARIABLE on line 9 at column 8
Loading history...
10
        protected string $name,
11
        protected int $age
12
    ) {}
13
14
    public function getId(): int
15
    {
16
        return $this->id;
17
    }
18
19
    #[JSONAPI\Attribute('name')]
20
    public function getName(): string
21
    {
22
        return $this->name;
23
    }
24
25
    #[JSONAPI\Attribute('name')]
26
    public function getAge(): int
27
    {
28
        return $this->age;
29
    }
30
}