pradosoft / prado

Prado - Component Framework for PHP
Other
187 stars 70 forks source link

TPriorityList and TPriorityMap updates for less variable copying and better organization #899

Closed belisoful closed 1 year ago

belisoful commented 1 year ago

This adds the TPriorityCollectionTrait to simply the TPriorityList/Map classes.

TPriorityList is made more efficient in reducing variable/array copying and has better error checking. This also adds support for copyFrom and MergeWith of TPriorityMap; where the keys are dropped and put in the order given.

TPriorityMap is made more efficient in reducing variable/array copying and add support for copyFrom and MergeWith a TPriorityList where the list index is treated as the key in the map. List index numbers are the new keys at the specified priority.

TWeakCallableCollection gets two new functions getIterator and toArray to account for changes in the TPriorityList code.

The new traits and classes are added the classes.php list.

Unit tests for the new code.

belisoful commented 1 year ago

Ready for Merge