Skip to content

Commit 6cccd22

Browse files
committed
MDL-75487 libraries: upgrade to version 2.0.3 of CFPropertyList.
1 parent f8d28e4 commit 6cccd22

File tree

5 files changed

+39
-33
lines changed

5 files changed

+39
-33
lines changed

lib/plist/classes/CFPropertyList/CFArray.php

+21-18
Original file line numberDiff line numberDiff line change
@@ -177,17 +177,18 @@ public function toArray()
177177
* @return void
178178
* @uses $iteratorPosition set to 0
179179
*/
180-
public function rewind()
180+
public function rewind(): void
181181
{
182182
$this->iteratorPosition = 0;
183183
}
184184

185185
/**
186186
* Get Iterator's current {@link CFType} identified by {@link $iteratorPosition}
187187
* @link http://php.net/manual/en/iterator.current.php
188-
* @return CFType current Item
188+
* @return mixed current Item
189189
* @uses $iteratorPosition identify current key
190190
*/
191+
#[\ReturnTypeWillChange]
191192
public function current()
192193
{
193194
return $this->value[$this->iteratorPosition];
@@ -196,9 +197,10 @@ public function current()
196197
/**
197198
* Get Iterator's current key identified by {@link $iteratorPosition}
198199
* @link http://php.net/manual/en/iterator.key.php
199-
* @return string key of the current Item
200+
* @return mixed key of the current Item: mixed
200201
* @uses $iteratorPosition identify current key
201202
*/
203+
#[\ReturnTypeWillChange]
202204
public function key()
203205
{
204206
return $this->iteratorPosition;
@@ -210,19 +212,19 @@ public function key()
210212
* @return void
211213
* @uses $iteratorPosition increment by 1
212214
*/
213-
public function next()
215+
public function next(): void
214216
{
215217
$this->iteratorPosition++;
216218
}
217219

218220
/**
219221
* Test if {@link $iteratorPosition} addresses a valid element of {@link $value}
220222
* @link http://php.net/manual/en/iterator.valid.php
221-
* @return boolean true if current position is valid, false else
223+
* @return bool true if current position is valid, false else
222224
* @uses $iteratorPosition test if within {@link $iteratorKeys}
223225
* @uses $iteratorPosition test if within {@link $value}
224226
*/
225-
public function valid()
227+
public function valid(): bool
226228
{
227229
return isset($this->value[$this->iteratorPosition]);
228230
}
@@ -233,53 +235,54 @@ public function valid()
233235

234236
/**
235237
* Determine if the array's key exists
236-
* @param string $key the key to check
238+
* @param string $offset the key to check
237239
* @return bool true if the offset exists, false if not
238240
* @link http://php.net/manual/en/arrayaccess.offsetexists.php
239241
* @uses $value to check if $key exists
240242
* @author Sean Coates <[email protected]>
241243
*/
242-
public function offsetExists($key)
244+
public function offsetExists($offset): bool
243245
{
244-
return isset($this->value[$key]);
246+
return isset($this->value[$offset]);
245247
}
246248

247249
/**
248250
* Fetch a specific key from the CFArray
249-
* @param string $key the key to check
251+
* @param mixed $offset the key to check
250252
* @return mixed the value associated with the key; null if the key is not found
251253
* @link http://php.net/manual/en/arrayaccess.offsetget.php
252254
* @uses get() to get the key's value
253255
* @author Sean Coates <[email protected]>
254256
*/
255-
public function offsetGet($key)
257+
#[\ReturnTypeWillChange]
258+
public function offsetGet($offset)
256259
{
257-
return $this->get($key);
260+
return $this->get($offset);
258261
}
259262

260263
/**
261264
* Set a value in the array
262-
* @param string $key the key to set
263-
* @param string $value the value to set
265+
* @param mixed $offset the key to set
266+
* @param mixed $value the value to set
264267
* @return void
265268
* @link http://php.net/manual/en/arrayaccess.offsetset.php
266269
* @uses setValue() to set the key's new value
267270
* @author Sean Coates <[email protected]>
268271
*/
269-
public function offsetSet($key, $value)
272+
public function offsetSet($offset, $value): void
270273
{
271-
return $this->setValue($value);
274+
$this->setValue($value);
272275
}
273276

274277
/**
275278
* Unsets a value in the array
276279
* <b>Note:</b> this dummy does nothing
277-
* @param string $key the key to set
280+
* @param mixed $offset the key to set
278281
* @return void
279282
* @link http://php.net/manual/en/arrayaccess.offsetunset.php
280283
* @author Sean Coates <[email protected]>
281284
*/
282-
public function offsetUnset($key)
285+
public function offsetUnset($offset): void
283286
{
284287
}
285288
}

lib/plist/classes/CFPropertyList/CFDictionary.php

+8-6
Original file line numberDiff line numberDiff line change
@@ -181,29 +181,31 @@ public function toArray()
181181
* @uses $iteratorPosition set to 0
182182
* @uses $iteratorKeys store keys of {@link $value}
183183
*/
184-
public function rewind()
184+
public function rewind(): void
185185
{
186186
$this->iteratorPosition = 0;
187187
$this->iteratorKeys = array_keys($this->value);
188188
}
189189
/**
190190
* Get Iterator's current {@link CFType} identified by {@link $iteratorPosition}
191191
* @link http://php.net/manual/en/iterator.current.php
192-
* @return CFType current Item
192+
* @return mixed current Item
193193
* @uses $iteratorPosition identify current key
194194
* @uses $iteratorKeys identify current value
195195
*/
196+
#[\ReturnTypeWillChange]
196197
public function current()
197198
{
198199
return $this->value[$this->iteratorKeys[$this->iteratorPosition]];
199200
}
200201
/**
201202
* Get Iterator's current key identified by {@link $iteratorPosition}
202203
* @link http://php.net/manual/en/iterator.key.php
203-
* @return string key of the current Item
204+
* @return mixed key of the current Item
204205
* @uses $iteratorPosition identify current key
205206
* @uses $iteratorKeys identify current value
206207
*/
208+
#[\ReturnTypeWillChange]
207209
public function key()
208210
{
209211
return $this->iteratorKeys[$this->iteratorPosition];
@@ -214,18 +216,18 @@ public function key()
214216
* @return void
215217
* @uses $iteratorPosition increment by 1
216218
*/
217-
public function next()
219+
public function next(): void
218220
{
219221
$this->iteratorPosition++;
220222
}
221223
/**
222224
* Test if {@link $iteratorPosition} addresses a valid element of {@link $value}
223225
* @link http://php.net/manual/en/iterator.valid.php
224-
* @return boolean true if current position is valid, false else
226+
* @return bool true if current position is valid, false else
225227
* @uses $iteratorPosition test if within {@link $iteratorKeys}
226228
* @uses $iteratorPosition test if within {@link $value}
227229
*/
228-
public function valid()
230+
public function valid(): bool
229231
{
230232
return isset($this->iteratorKeys[$this->iteratorPosition]) && isset($this->value[$this->iteratorKeys[$this->iteratorPosition]]);
231233
}

lib/plist/classes/CFPropertyList/CFPropertyList.php

+8-6
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ public function purge()
591591

592592
/**
593593
* Get first (and only) child, or complete collection.
594-
* @param string $cftype if set to true returned value will be CFArray instead of an array in case of a collection
594+
* @param boolean $cftype if set to true returned value will be CFArray instead of an array in case of a collection
595595
* @return CFType|array CFType or list of CFTypes known to the PropertyList
596596
* @uses $value for retrieving CFTypes
597597
*/
@@ -667,7 +667,7 @@ public function toArray()
667667
* @uses $iteratorPosition set to 0
668668
* @uses $iteratorKeys store keys of {@link $value}
669669
*/
670-
public function rewind()
670+
public function rewind(): void
671671
{
672672
$this->iteratorPosition = 0;
673673
$this->iteratorKeys = array_keys($this->value);
@@ -676,10 +676,11 @@ public function rewind()
676676
/**
677677
* Get Iterator's current {@link CFType} identified by {@link $iteratorPosition}
678678
* @link http://php.net/manual/en/iterator.current.php
679-
* @return CFType current Item
679+
* @return mixed current Item
680680
* @uses $iteratorPosition identify current key
681681
* @uses $iteratorKeys identify current value
682682
*/
683+
#[\ReturnTypeWillChange]
683684
public function current()
684685
{
685686
return $this->value[$this->iteratorKeys[$this->iteratorPosition]];
@@ -688,10 +689,11 @@ public function current()
688689
/**
689690
* Get Iterator's current key identified by {@link $iteratorPosition}
690691
* @link http://php.net/manual/en/iterator.key.php
691-
* @return string key of the current Item
692+
* @return mixed key of the current Item
692693
* @uses $iteratorPosition identify current key
693694
* @uses $iteratorKeys identify current value
694695
*/
696+
#[\ReturnTypeWillChange]
695697
public function key()
696698
{
697699
return $this->iteratorKeys[$this->iteratorPosition];
@@ -703,7 +705,7 @@ public function key()
703705
* @return void
704706
* @uses $iteratorPosition increment by 1
705707
*/
706-
public function next()
708+
public function next(): void
707709
{
708710
$this->iteratorPosition++;
709711
}
@@ -715,7 +717,7 @@ public function next()
715717
* @uses $iteratorPosition test if within {@link $iteratorKeys}
716718
* @uses $iteratorPosition test if within {@link $value}
717719
*/
718-
public function valid()
720+
public function valid(): bool
719721
{
720722
return isset($this->iteratorKeys[$this->iteratorPosition]) && isset($this->value[$this->iteratorKeys[$this->iteratorPosition]]);
721723
}

lib/plist/readme_moodle.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CFPropertyList library
22
---------------
33

4-
Downloaded last release from: https://github.com/TECLIB/CFPropertyList/releases/
4+
Downloaded last release from: https://github.com/TECLIB/CFPropertyList/tags
55

66
Import procedure:
77

@@ -18,4 +18,3 @@ Removed:
1818
Added:
1919
* readme_moodle.txt
2020

21-
Downloaded version: 2.0.2

lib/thirdpartylibs.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ All rights reserved.</copyright>
573573
<location>plist</location>
574574
<name>plist</name>
575575
<description>PHP Implementation of Apple's PList (binary and XML).</description>
576-
<version>2.0.2</version>
576+
<version>2.0.3</version>
577577
<license>MIT</license>
578578
<repository>https://github.com/TECLIB/CFPropertyList</repository>
579579
<copyrights>

0 commit comments

Comments
 (0)