New PSR for data querying#1284
Conversation
|
Interesting. We have a different approach to similar problem at Yii: https://github.com/yiisoft/data |
|
@samdark I really like how you managed filters! This is a great way to do this I didn't think of! |
proposed/query.md
Outdated
| * | ||
| * @return QueryInterface | ||
| */ | ||
| public static function from(iterable $source, QueryContextInterface $context = null): QueryInterface; |
There was a problem hiding this comment.
| public static function from(iterable $source, QueryContextInterface $context = null): QueryInterface; | |
| public static function from(iterable $source, QueryContextInterface $context = null): static; |
This is precisely the use case static returns were added for.
There was a problem hiding this comment.
That's right, I updated it!
| * | ||
| * @return QueryContextInterface | ||
| */ | ||
| public function getContext(): QueryContextInterface; |
There was a problem hiding this comment.
"context objects" are a code smell.
There was a problem hiding this comment.
I can understand this. Maybe getContext, context arguments and QueryContextInterface could simply be removed!
proposed/query.md
Outdated
| * | ||
| * @return QueryInterface | ||
| */ | ||
| public function applyModifier(QueryModifierInterface $modifier): QueryInterface; |
There was a problem hiding this comment.
Fixed as well. And also learnt what "ibid" stands for, thanks! 😄
115d1e6 to
9b34ac6
Compare
proposed/query.md
Outdated
| */ | ||
| interface QueryInterface | ||
| { | ||
| /**namespace Psr\Query; |
There was a problem hiding this comment.
This namespace looks like a cut&paste error?
There was a problem hiding this comment.
Yep, definitely. Thank you!
9b34ac6 to
5cd59f1
Compare
ashnazg
left a comment
There was a problem hiding this comment.
Looks interesting to me...
|
Could you show an example of usage? In meta-document or just in comment? |
|
This didn't go anywhere. |
A new PSR to standardize how data can be queried.
Here is the Google Groups thread: https://groups.google.com/g/php-fig/c/bKg4OvW-wcY