1<?php
2
3declare(strict_types=1);
4
5namespace JMS\Serializer\Tests\Fixtures;
6
7use JMS\Serializer\Annotation\AccessType;
8use JMS\Serializer\Annotation\Exclude;
9use JMS\Serializer\Annotation\ReadOnly;
10use JMS\Serializer\Annotation\Type;
11
12/** @AccessType("public_method") */
13class GetSetObject
14{
15    /** @AccessType("property") @Type("integer") */
16    private $id = 1;
17
18    /** @Type("string") */
19    private $name = 'Foo';
20
21    /**
22     * @ReadOnly
23     */
24    private $readOnlyProperty = 42;
25
26    /**
27     * This property should be exlcluded
28     *
29     * @Exclude()
30     */
31    private $excludedProperty;
32
33    public function getId()
34    {
35        throw new \RuntimeException('This should not be called.');
36    }
37
38    public function getName()
39    {
40        return 'Johannes';
41    }
42
43    public function setName($name)
44    {
45        $this->name = $name;
46    }
47
48    public function getReadOnlyProperty()
49    {
50        return $this->readOnlyProperty;
51    }
52}
53