|
15 | 15 | * This class is internal to the library and should not be referenced by consumer code. |
16 | 16 | * Backwards Incompatible changes can occur in Minor and Patch Releases. |
17 | 17 | * |
| 18 | + * @internal |
| 19 | + * |
| 20 | + * @psalm-internal Laminas\Feed |
| 21 | + * @psalm-internal LaminasTest\Feed |
| 22 | + * |
| 23 | + * @psalm-type FundingObject = object{ |
| 24 | + * title: string, |
| 25 | + * url: string |
| 26 | + * } |
18 | 27 | * @psalm-type LicenseObject = object{ |
19 | 28 | * identifier: string, |
20 | | - * url?: string |
| 29 | + * url: string |
21 | 30 | * } |
22 | 31 | * @psalm-type LocationObject = object{ |
23 | 32 | * description: string, |
24 | | - * geo?: string, |
25 | | - * osm?: string, |
26 | | - * rel?: string, |
27 | | - * country?: string, |
| 33 | + * geo: string, |
| 34 | + * osm: string, |
| 35 | + * rel: string, |
| 36 | + * country: string, |
28 | 37 | * } |
29 | 38 | * @psalm-type BlockObject = object{ |
30 | 39 | * value: string, |
31 | | - * id?: string |
| 40 | + * id: string |
32 | 41 | * } |
33 | 42 | * @psalm-type TxtObject = object{ |
34 | 43 | * value: string, |
35 | | - * purpose?: string |
| 44 | + * purpose: string |
36 | 45 | * } |
37 | 46 | * @psalm-type UpdateFrequencyObject = object{ |
38 | 47 | * description: string, |
39 | | - * complete?: bool, |
40 | | - * dtstart?: DateTimeInterface, |
41 | | - * rrule?: string |
| 48 | + * complete: bool, |
| 49 | + * dtstart: DateTimeInterface, |
| 50 | + * rrule: string |
42 | 51 | * } |
43 | 52 | * @psalm-type PersonObject = object{ |
44 | 53 | * name: string, |
45 | | - * role?: string, |
46 | | - * group?: string, |
47 | | - * img?: string, |
48 | | - * href?: string |
| 54 | + * role: string, |
| 55 | + * group: string, |
| 56 | + * img: string, |
| 57 | + * href: string |
49 | 58 | * } |
50 | 59 | * @psalm-type TrailerObject = object{ |
51 | 60 | * title: string, |
52 | 61 | * pubdate: string, |
53 | 62 | * url: string, |
54 | | - * length?: int, |
55 | | - * type?: string, |
56 | | - * season?: int |
| 63 | + * length: int, |
| 64 | + * type: string, |
| 65 | + * season: int |
57 | 66 | * } |
58 | 67 | * @psalm-type RemoteItemObject = object{ |
59 | 68 | * feedGuid: string, |
60 | | - * feedUrl?: string, |
61 | | - * itemGuid?: string, |
62 | | - * medium?: string, |
63 | | - * title?: string |
| 69 | + * feedUrl: string, |
| 70 | + * itemGuid: string, |
| 71 | + * medium: string, |
| 72 | + * title: string |
64 | 73 | * } |
65 | 74 | * @psalm-type ValueRecipientObject = object{ |
66 | 75 | * type: string, |
67 | 76 | * address: string, |
68 | 77 | * split: int, |
69 | | - * name?: string, |
70 | | - * customKey?: string, |
71 | | - * customValue?: string, |
72 | | - * fee?: bool, |
| 78 | + * name: string, |
| 79 | + * customKey: string, |
| 80 | + * customValue: string, |
| 81 | + * fee: bool, |
73 | 82 | * } |
74 | 83 | * @psalm-type ValueTimeSplitObject = object{ |
75 | 84 | * startTime: int, |
76 | 85 | * duration: int, |
77 | | - * remoteStartTime?: int, |
78 | | - * remotePercentage?: int, |
79 | | - * valueRecipients?: list<ValueRecipientObject>, |
80 | | - * remoteItem?: RemoteItemObject |
| 86 | + * remoteStartTime: int, |
| 87 | + * remotePercentage: int, |
| 88 | + * valueRecipients: list<ValueRecipientObject>, |
| 89 | + * remoteItem: RemoteItemObject |
81 | 90 | * } |
82 | 91 | * @psalm-type ValueObject = object{ |
83 | 92 | * type: string, |
84 | 93 | * method: string, |
85 | | - * suggested?: float, |
| 94 | + * suggested: float, |
86 | 95 | * valueRecipients: list<ValueRecipientObject>, |
87 | | - * valueTimeSplits?: list<ValueTimeSplitObject>, |
| 96 | + * valueTimeSplits: list<ValueTimeSplitObject>, |
88 | 97 | * } |
89 | 98 | * @psalm-type ImagesObject = object{ |
90 | 99 | * srcset: string, |
91 | 100 | * } |
92 | 101 | * @psalm-type DetailedImageObject = object{ |
93 | 102 | * href: string, |
94 | | - * alt?: string, |
95 | | - * purpose?: string, |
96 | | - * type?: string, |
97 | | - * aspectRatio?: string, |
98 | | - * width?: int, |
99 | | - * height?: int, |
| 103 | + * alt: string, |
| 104 | + * purpose: string, |
| 105 | + * type: string, |
| 106 | + * aspectRatio: string, |
| 107 | + * width: int, |
| 108 | + * height: int, |
100 | 109 | * } |
101 | 110 | * @psalm-type SocialInteractObject = object{ |
102 | 111 | * protocol: string, |
103 | 112 | * uri: string, |
104 | | - * priority?: int, |
105 | | - * accountId?: string, |
106 | | - * accountUrl?: string, |
| 113 | + * priority: int, |
| 114 | + * accountId: string, |
| 115 | + * accountUrl: string, |
107 | 116 | * } |
108 | 117 | * @psalm-type TranscriptObject = object{ |
109 | 118 | * url: string, |
110 | 119 | * type: string, |
111 | | - * language?: string, |
112 | | - * rel?: string |
| 120 | + * language: string, |
| 121 | + * rel: string |
113 | 122 | * } |
114 | 123 | * @psalm-type ChaptersObject = object{ |
115 | 124 | * url: string, |
116 | 125 | * type: string |
117 | 126 | * } |
118 | 127 | * @psalm-type SoundbiteObject = object{ |
119 | | - * title?: string, |
| 128 | + * title: string, |
120 | 129 | * startTime: string, |
121 | 130 | * duration: string |
122 | 131 | * } |
123 | 132 | * @psalm-type SeasonObject = object{ |
124 | 133 | * value: int, |
125 | | - * name?: string |
| 134 | + * name: string |
126 | 135 | * } |
127 | 136 | * @psalm-type EpisodeObject = object{ |
128 | 137 | * value: int|float, |
129 | | - * display?: string |
| 138 | + * display: string |
130 | 139 | * } |
131 | 140 | * @psalm-type SourceObject = object{ |
132 | 141 | * uri: string, |
133 | | - * contentType?: string |
| 142 | + * contentType: string |
134 | 143 | * } |
135 | 144 | * @psalm-type IntegrityObject = object{ |
136 | 145 | * type: string, |
137 | 146 | * value: string |
138 | 147 | * } |
139 | 148 | * @psalm-type AlternateEnclosureObject = object{ |
140 | 149 | * type: string, |
141 | | - * length?: int, |
142 | | - * bitrate?: int|float, |
143 | | - * height?: int, |
144 | | - * lang?: string, |
145 | | - * title?: string, |
146 | | - * rel?: string, |
147 | | - * codecs?: string, |
148 | | - * default?: bool, |
149 | | - * sources: list<SourceObject>, |
150 | | - * integrity?: IntegrityObject, |
151 | | - * } |
152 | | - * @psalm-internal Laminas\Feed |
153 | | - * @psalm-internal LaminasTest\Feed |
| 150 | + * length: int, |
| 151 | + * bitrate: int|float, |
| 152 | + * height: int, |
| 153 | + * lang: string, |
| 154 | + * title: string, |
| 155 | + * rel: string, |
| 156 | + * codecs: string, |
| 157 | + * default: bool, |
| 158 | + * sources: list<SourceObject>, |
| 159 | + * integrity: IntegrityObject, |
| 160 | + * } |
| 161 | + * @psalm-type ContentLinkObject = object{ |
| 162 | + * href: string, |
| 163 | + * description: string, |
| 164 | + * } |
| 165 | + * @psalm-type ChatObject = object{ |
| 166 | + * server: string, |
| 167 | + * protocol: string, |
| 168 | + * accountId: string, |
| 169 | + * space: string, |
| 170 | + * } |
154 | 171 | */ |
155 | 172 | final class AttributesReader |
156 | 173 | { |
@@ -443,4 +460,45 @@ public static function readIntegrity(DOMElement $item): object |
443 | 460 | $object->value = $item->getAttribute('value'); |
444 | 461 | return $object; |
445 | 462 | } |
| 463 | + |
| 464 | + /** |
| 465 | + * Read content link |
| 466 | + * |
| 467 | + * @psalm-return ContentLinkObject |
| 468 | + */ |
| 469 | + public static function readContentLink(DOMElement $item): object |
| 470 | + { |
| 471 | + $object = new stdClass(); |
| 472 | + $object->href = $item->getAttribute('href'); |
| 473 | + $object->description = $item->nodeValue; |
| 474 | + return $object; |
| 475 | + } |
| 476 | + |
| 477 | + /** |
| 478 | + * Read podcast funding |
| 479 | + * |
| 480 | + * @psalm-return FundingObject |
| 481 | + */ |
| 482 | + public static function readFunding(DOMElement $item): object |
| 483 | + { |
| 484 | + $object = new stdClass(); |
| 485 | + $object->url = $item->getAttribute('url'); |
| 486 | + $object->title = $item->nodeValue; |
| 487 | + return $object; |
| 488 | + } |
| 489 | + |
| 490 | + /** |
| 491 | + * Read podcast chat |
| 492 | + * |
| 493 | + * @psalm-return ChatObject |
| 494 | + */ |
| 495 | + public static function readChat(DOMElement $item): object |
| 496 | + { |
| 497 | + $object = new stdClass(); |
| 498 | + $object->server = $item->getAttribute('server'); |
| 499 | + $object->protocol = $item->getAttribute('protocol'); |
| 500 | + $object->accountId = $item->getAttribute('accountId'); |
| 501 | + $object->space = $item->getAttribute('space'); |
| 502 | + return $object; |
| 503 | + } |
446 | 504 | } |
0 commit comments