-
Notifications
You must be signed in to change notification settings - Fork 10
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
Table should provide more read options #29
Comments
Because PHP doesn't have named parameters, and also to keep Table class small and simple, I'm thinking of an interface like this: $table->reader()->cast(false)->read();
$table->reader()->keyed(false)->limit(5)->read() Could also provide an iter() method that instead of returning an array will return an iterator The |
all the functionality needed to implemented the TableReader is already available in the Table class
|
Does PHP support JavaScript/Ruby pattern like?
To have something like:
|
yes, but it has too many disadvantage IMO, mainly:
both points can be solved by:
both require more work from developers of the library, easy to forget to update documentation / validation That's why I think the solution I proposed is better (I would recommend it for JS as well, don't know about Ruby). There is another option for using parameters object, but that's very cumbersome, especially in PHP |
That's good points. Just a few thoughts from the whole ecosystem perspective:
|
done in f97fd9d |
feature requests from @roll (See original request in #25)
Table class should provide more read options:
table.read(cast=false) // list of strings
read(limit=10)
could be achievedcast=false
(because header-values map doesn't work in this case)The text was updated successfully, but these errors were encountered: