Closed RoadSigns closed 2 years ago
Hi @RoadSigns , this PR looks amazing. Thank you!!!!!!!
I'm going to merge it into main. I will test a bit the main branch (after the merge) and then i will create a release. The release will be 0.1.0 (i want to increment the minor).
Summary
With this pull request, I've changed the underlying data structure of the rows within the
Table
class to be of typeArr
instead ofarray
. This allows us to lean on all of the methods within theArr
object instead of recreating them.Since we are now using
Arr
as the data structure, this has meant that we have stopped the extension of theArr
class. This allows us to ensure that we aren't providing public methods from theTable
class that don't work with a multidimensional array.Implementing Countable
We are now implementing
\Countable
in theTable
class. This will allow us to use methods likecount()
to count the number of rows within the Table without the need for users to access properties. However there is one available if needed$table->count()
.Implementing Iterator
We are not implementing
\Iterator
in theTable
class. This allows us to loop over theTable
object using loops or array methods to access the rows.Updating the Select and Except method parameters from array to variable-length argument lists
The method parameters have been updated from array to variable-length argument lists, this allows us to ensure that the arguments being passed in are the correct type and we aren't going to experience someone trying to get columns of type
stdClass
inside of theint
orstring
.Set and Unset in the Arr Class
Two new methods have been added to
Arr
class to allow people to set and unset elements within theArr
by their keys.