-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor/62 cleanup #76
Open
nozavroni
wants to merge
46
commits into
master
Choose a base branch
from
refactor/62-cleanup
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
After a whole lot of refactoring and adding ALL of the new methods I wanted to add, I have finally gotten a SINGLE testcase class passing. So I'm committing it. This commit covers a LOT of ground though. I'll try to list all of it but I'm sure I'll miss something: * Added indexOf() method - refs #20 * Added random() method - refs #39 * Added namespaced helper functions collect(), invoke(), is_traversable(), is_arrayable(), to_array(), and typeof() - refs #42 * Renamed getValueAtPosition() and getKeyAtPosition() to getOffset() and getOffsetKey() - refs #45 * Added CollectionInterface - refs #39 * Added Arrayable support with ArrayableInterface and is_arrayable() - refs #23 * Using Laravel's collections for inspiration, I rounded out my main collection mehods which are defined in CollectionInterface - refs #30 * Added to_array() method which is somewhat similar to Laravel's getArrayableItems(), but it still needs some work - refs #31 * A whole bunch of other minor changes I still need to get the remaining unit tests working and I need to add unit tests for the new methods I added with this commit.
Removed NumericCollection and AbstractCollection, leaving only Collection and CollectionInterface - resolves #50
* Removed all methods that required mutability from both CollectionInterface and Collection. * For methods such as set() and add(), I simulate this functionality by returning a new collection with these methods performed on it. * Removed unit tests that tested methods mentioned in my previous point because they test for those methods as if collections were mutable. So I will need to update the tests to test the return collection for changes and test that the original collection did not change. refs #52
Added some methods to my base unit test case class that allows me to "watch" an object over the course of a test and then at the end, assert that it has not changed in any discernable way. This will help me immensely while trying to unit test that my collection methods are respecting collection object immutability. I have implemented this assert method in all existing tests that warrant it.
* references "feature"
Added _() function, contextual function somewhat like jQuery's $(). Does different things depending what you pass to it. Right now it supports two operations only, but I will likely add more (if I decide to keep it). * alias for invoke() _(function() {}) * alias for collect() _([1,2,3]) * alias for with()/() _(new SomeClass)->doSomething() References #55
Very minor changes to implementation of Collection::setData().
Implemented and unit tested the Collection::zip() method - refs #47
* Added bracket index (offset and negative offset) access to Sequence collections. * Added bracking slice access using $seq['start:end'] syntax (returns an array)
* Added IsArrayable trait to Sequence * Implemented and added tests for Sequence methods "pipe", "every", "none", and "first"
… diff, and diffKeys - refs #47
… negative indexes. - refs #47
…he appropriate times - refs #47
* Added "phpunit/php-code-coverage" to dev dependencies * Ran composer update
According to my code coverage reports, several Noz\* functions had still yet to be unit tested, either in part, or at all. This commit should cover every function in the Noz namespace. - refs #47
* Renamed Lst -> LList * Refactored Sequence::__invoke() because I intend to do something similar with LList
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.