Accept an array of properties in get/getLiteral/getResource methods #326
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.
This PR changes the implementation of EasyRdf\Graph::get to accept an array of properties. Previously the implementation was inconsistent with the phpdoc declarations: the phpdocs for getLiteral and getResource methods in both Graph and Resource classes state that it is possible to pass an array of properties, but it didn't actually work (see #325). Also the phpdoc description for Graph::get hints that it is possible to pass an array.
The PR straightens out this wrinkle so that it is actually possible to pass an array to all the above mentioned methods. The actual fix was simple - only two new lines of code - but then I had to change the phpdoc a little to reflect that, and also the exception message that complains about bad values now makes it clear that an array is accepted, too.
Finally I had to do small changes to existing unit tests that check for the exception message, plus I added two more to verify that passing an array of properties actually works as intended.
Fixes #325, ping @k00ni