1<?php
2
3declare(strict_types=1);
4
5namespace JMS\Serializer\Tests\Fixtures;
6
7use JMS\Serializer\Annotation\SerializedName;
8use JMS\Serializer\Annotation\Type;
9use JMS\Serializer\Annotation\XmlElement;
10use JMS\Serializer\Annotation\XmlList;
11use JMS\Serializer\Annotation\XmlMap;
12use JMS\Serializer\Annotation\XmlNamespace;
13use JMS\Serializer\Annotation\XmlRoot;
14
15/**
16 * @XmlRoot("ObjectWithNamespacesAndList", namespace="http://example.com/namespace")
17 * @XmlNamespace(uri="http://example.com/namespace")
18 * @XmlNamespace(uri="http://example.com/namespace2", prefix="x")
19 */
20class ObjectWithNamespacesAndList
21{
22    /**
23     * @Type("string")
24     * @SerializedName("name")
25     * @XmlElement(namespace="http://example.com/namespace")
26     */
27    public $name;
28    /**
29     * @Type("string")
30     * @SerializedName("name")
31     * @XmlElement(namespace="http://example.com/namespace2")
32     */
33    public $nameAlternativeB;
34
35    /**
36     * @Type("array<string>")
37     * @SerializedName("phones")
38     * @XmlElement(namespace="http://example.com/namespace2")
39     * @XmlList(inline = false, entry = "phone", namespace="http://example.com/namespace2")
40     */
41    public $phones;
42    /**
43     * @Type("array<string,string>")
44     * @SerializedName("addresses")
45     * @XmlElement(namespace="http://example.com/namespace2")
46     * @XmlMap(inline = false, entry = "address", keyAttribute = "id", namespace="http://example.com/namespace2")
47     */
48    public $addresses;
49
50    /**
51     * @Type("array<string>")
52     * @SerializedName("phones")
53     * @XmlList(inline = true, entry = "phone", namespace="http://example.com/namespace")
54     */
55    public $phonesAlternativeB;
56    /**
57     * @Type("array<string,string>")
58     * @SerializedName("addresses")
59     * @XmlMap(inline = true, entry = "address", keyAttribute = "id", namespace="http://example.com/namespace")
60     */
61    public $addressesAlternativeB;
62
63    /**
64     * @Type("array<string>")
65     * @SerializedName("phones")
66     * @XmlList(inline = true, entry = "phone",  namespace="http://example.com/namespace2")
67     */
68    public $phonesAlternativeC;
69    /**
70     * @Type("array<string,string>")
71     * @SerializedName("addresses")
72     * @XmlMap(inline = true, entry = "address", keyAttribute = "id", namespace="http://example.com/namespace2")
73     */
74    public $addressesAlternativeC;
75
76    /**
77     * @Type("array<string>")
78     * @SerializedName("phones")
79     * @XmlList(inline = false, entry = "phone")
80     */
81    public $phonesAlternativeD;
82    /**
83     * @Type("array<string,string>")
84     * @SerializedName("addresses")
85     * @XmlMap(inline = false, entry = "address", keyAttribute = "id")
86     */
87    public $addressesAlternativeD;
88}
89