Issues (26)

docs/examples/Articles.php (1 issue)

Labels
Severity
1
<?php
2
3
use JSONAPI\Resource\Attributes as JSONAPI;
4
5
#[JSONAPI\Resource('articles')]
6
class Articles
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 $title,
11
        protected People $author,
12
    ) {}
13
14
    public function getId(): int
15
    {
16
        return $this->id;
17
    }
18
19
    #[JSONAPI\Attribute()]
20
    public function getTitle(): string
21
    {
22
        return $this->title;
23
    }
24
25
    #[JSONAPI\Relationship('author')]
26
    public function getAuthor(): ?People
27
    {
28
        return $this->author;
29
    }
30
}