Skip to content

Commit 8dc95f7

Browse files
committed
Add some typehinting to CultureFeed_Uitpas_Event_CultureEvent
1 parent 2be4e97 commit 8dc95f7

File tree

1 file changed

+23
-139
lines changed

1 file changed

+23
-139
lines changed

CultureFeed/CultureFeed/Uitpas/Event/CultureEvent.php

Lines changed: 23 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -69,170 +69,54 @@ class CultureFeed_Uitpas_Event_CultureEvent extends CultureFeed_Uitpas_ValueObje
6969
*/
7070
public $distributionKey;
7171

72-
/**
73-
* The volume constraint added for registering an event
74-
*
75-
* @var integer
76-
*/
77-
public $volumeConstraint;
72+
public int $volumeConstraint;
7873

79-
/**
80-
* date format yyyy-mm-dd added for registering an event
81-
*
82-
* @var string
83-
*/
84-
public $timeConstraintFrom;
74+
public string $timeConstraintFrom;
8575

86-
/**
87-
* date format yyyy-mm-dd added for registering an event
88-
*
89-
* @var string
90-
*/
91-
public $timeConstraintTo;
76+
public string $timeConstraintTo;
77+
public string $periodConstraintVolume;
9278

93-
/**
94-
* added for registering an event
95-
*
96-
* @var string
97-
*/
98-
public $periodConstraintVolume;
79+
public string $periodConstraintType;
9980

81+
public bool $degressive;
10082

101-
/**
102-
* added for registering an event
103-
*
104-
* One of DAY, WEEK, MONTH, QUARTER or YEAR.
105-
*
106-
* @var string
107-
*/
108-
public $periodConstraintType;
83+
public string $checkinPeriodConstraintType;
10984

110-
/**
111-
* added for registering an event
112-
*
113-
* From API:
114-
* True, indien periodConstraint degressief is.
115-
* Dit is enkel mogelijk bij periodConstraintType YEAR.
116-
*
117-
* @var boolean
118-
*/
119-
public $degressive;
120-
121-
/**
122-
* added for registering an event
123-
*
124-
* One of DAY, WEEK, MONTH, QUARTER or YEAR.
125-
*
126-
* @var string
127-
*/
128-
public $checkinPeriodConstraintType;
129-
130-
131-
/**
132-
* The checkin constraint added for registering an event
133-
*
134-
* @var integer
135-
*/
136-
public $checkinPeriodConstraintVolume;
85+
public int $checkinPeriodConstraintVolume;
13786

87+
public ?string $organiserName;
13888

139-
/**
140-
* The organiserName van de inrichter
141-
*
142-
* @var string
143-
*/
144-
public $organiserName;
145-
146-
/**
147-
* The city
148-
*
149-
* @var string
150-
*/
151-
public $city;
89+
public ?string $city;
15290

153-
/**
154-
* True if a given passholder can checkin on the event
155-
*
156-
* @var boolean
157-
*/
158-
public $checkinAllowed;
91+
public bool $checkinAllowed = true;
15992

160-
/**
161-
* The checkin constraint of the event
162-
*
163-
* @var CultureFeed_Uitpas_Event_CheckinConstraint
164-
*/
165-
public $checkinConstraint;
93+
public CultureFeed_Uitpas_Event_CheckinConstraint $checkinConstraint;
16694

167-
/**
168-
* The reason the passholder cannot check in on the event
169-
*
170-
* @var string
171-
*/
172-
public $checkinConstraintReason;
95+
public ?string $checkinConstraintReason;
17396

174-
/**
175-
* The checkin start date.
176-
*
177-
* @var int
178-
*/
179-
public $checkinStartDate;
97+
public ?int $checkinStartDate;
18098

181-
/**
182-
* The checkin end date.
183-
*
184-
* @var int
185-
*/
186-
public $checkinEndDate;
99+
public ?int $checkinEndDate;
187100

188-
/**
189-
* The reason the passholder cannot buy tickets for the event
190-
*
191-
* @var string
192-
*/
193-
public $buyConstraintReason;
101+
public ?string $buyConstraintReason;
194102

195-
/**
196-
* The price of the event
197-
*
198-
* @var float
199-
*/
200-
public $price;
103+
public ?float $price;
201104

202105
/**
203-
* The price names of the event
204-
*
205106
* @var string[]
206107
*/
207-
public $postPriceNames;
108+
public array $postPriceNames;
208109

209110
/**
210-
* The price values of the event
211-
*
212111
* @var float[]
213112
*/
214-
public $postPriceValues;
113+
public array $postPriceValues;
215114

216-
/**
217-
* The tariff of the event for a given passholder
218-
*
219-
* @var float
220-
*/
221-
public $tariff;
115+
public ?float $tariff;
222116

223-
/**
224-
* The title of the event
225-
*
226-
* @var string
227-
*/
228-
public $title;
117+
public ?string $title;
229118

230-
/**
231-
* The calendar description of the event
232-
*
233-
* @var CultureFeed_Uitpas_Calendar
234-
*/
235-
public $calendar;
119+
public CultureFeed_Uitpas_Calendar $calendar;
236120

237121
public int $numberOfPoints;
238122

@@ -319,7 +203,7 @@ public static function createFromXML(CultureFeed_SimpleXMLElement $object): Cult
319203
$event->organiserId = $object->xpath_str('organiserId');
320204
$event->organiserName = $object->xpath_str('organiserName');
321205
$event->city = $object->xpath_str('city');
322-
$event->checkinAllowed = $object->xpath_bool('checkinAllowed');
206+
$event->checkinAllowed = $object->xpath_bool('checkinAllowed')!== null ? $object->xpath_bool('checkinAllowed') : true;
323207
$event->checkinConstraint = CultureFeed_Uitpas_Event_CheckinConstraint::createFromXML($object->xpath('checkinConstraint', false));
324208
$event->checkinConstraintReason = $object->xpath_str('checkinConstraintReason');
325209
$event->checkinStartDate = $object->xpath_time('checkinStartDate');

0 commit comments

Comments
 (0)