pradosoft / prado

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

TPriorityXX update for common priority trait and interface #897

Closed belisoful closed 1 year ago

belisoful commented 1 year ago

There are some commonalities between TPriorityList and TPriorityMap that I'd like to abstract into a TPriorityCollectionTrait

I'm reviewing a lot of the list/map code to make sure the TWeakCallableCollection is fully functional and I've been finding some places for better code in the TPriorityList and TPriorityMap.

This issue is for updating the priority collection code.

belisoful commented 1 year ago

BTW, I found a bug in TPriorityList::insertAt. When the list is [] and we insertAt(0), there was an out-of-range error. I added a unit test and fixed the bug.

belisoful commented 1 year ago

I'm taking my time with this. I am writing the unit tests for the corrected (scrubbing) TWeakCallableCollection. (it uses the TWeakCollectionTrait, of course)

I may find more updates for TPriorityXX until TWeakCallableCollection ['TWCC'] unit testing is complete. I'm about half way through writing the unit tests for TWCC. Basically, the scrubber needs to be tested that it's being done properly in each method.