# |
Jul 25th 2017, 11:18 |
inoas |
then you DRY |
# |
Jul 25th 2017, 11:18 |
inoas |
the class should have it anyway, it should even has a language keyword like "frozen" or "immutable" but php doesn't do that (yet) |
# |
Jul 25th 2017, 11:17 |
neon1024 |
So you’ve moved the keyword from the method to the class. |
# |
Jul 25th 2017, 11:16 |
inoas |
and with request because of PSR7 there will be getters anyway |
# |
Jul 25th 2017, 11:16 |
inoas |
The only thing this requires is understanding the context of objects you work with. Are they vanilla or builders or immutable/writers |
# |
Jul 25th 2017, 11:15 |
inoas |
(new ImmutableRequest)->data('author') obviously gets data as it is immutable and thus requires with* to create clones |
# |
Jul 25th 2017, 11:14 |
neon1024 |
I’m having to install C++ :O |
# |
Jul 25th 2017, 11:13 |
robertpustulka |
@inoas does `$this->request->data('Author')` set a `data` property to `Author` value, or get the `Author` key from a `data` array? :) |
# |
Jul 25th 2017, 11:13 |
inoas |
feels for neon1024 |
# |
Jul 25th 2017, 11:13 |
neon1024 |
I’ll look into it once I’ve got PHP working in Windows 10 ;) |
# |
Jul 25th 2017, 11:12 |
inoas |
(on average, java pays more, all I am saying!) |
# |
Jul 25th 2017, 11:12 |
inoas |
at least your income will go up :p |
# |
Jul 25th 2017, 11:11 |
inoas |
;-) |
# |
Jul 25th 2017, 11:11 |
inoas |
haha |
# |
Jul 25th 2017, 11:11 |
inoas |
now sounds like you want to really do java ;p (and by the way, on the typing thing I am with you... strict typing is good stuff) |
# |
Jul 25th 2017, 11:11 |
neon1024 |
Perhaps I should move from PHP to Java |
# |
Jul 25th 2017, 11:10 |
neon1024 |
$tableNameString |
# |
Jul 25th 2017, 11:10 |
neon1024 |
I often name variables with type as well |
# |
Jul 25th 2017, 11:10 |
neon1024 |
‘I am taking this thing and doing this to it’ |
# |
Jul 25th 2017, 11:10 |
neon1024 |
I want my code to speak to me |
# |
Jul 25th 2017, 11:10 |
neon1024 |
and I am not a robot, I’m just lazy |
# |
Jul 25th 2017, 11:10 |
neon1024 |
I don’t agree with that unfortunatly |
# |
Jul 25th 2017, 11:07 |
inoas |
unambigouous (hope that's right) |
# |
Jul 25th 2017, 11:06 |
inoas |
as I said, you are NOT a robot and reading $this->request->data('Author') is umabigious ... and also correctly typed now that magic methods are gone |
# |
Jul 25th 2017, 11:05 |
neon1024 |
I guess we’ll see what the choice is in the RFC :slightly_smiling_face: |
# |
Jul 25th 2017, 11:04 |
neon1024 |
Reading will be less effort for me, as the code tells me what it’s doing just by reading it |
# |
Jul 25th 2017, 11:04 |
inoas |
;-) |
# |
Jul 25th 2017, 11:04 |
neon1024 |
Worried you’ll wear away your fingerprints? :slightly_smiling_face: |
# |
Jul 25th 2017, 11:04 |
neon1024 |
lol |
# |
Jul 25th 2017, 11:03 |
inoas |
and the other consequence will be that we add setters/getters everywhere and reading/writing code will be a lot more work |
# |
Jul 25th 2017, 11:03 |
inoas |
The consequence will be that the query builder will be excempted and we will have inconsistency... the reasons being: deprecation of magic method is easier (markstory) and PSR7 enforces get verbosity even on immutable objects (as it seems, which seems to be bad design in PSR7) |
# |
Jul 25th 2017, 11:02 |
inoas |
I am not catching the train now ;)) |
# |
Jul 25th 2017, 11:01 |
neon1024 |
It’s worthwhile to discuss though |
# |
Jul 25th 2017, 11:01 |
inoas |
what?;) |
# |
Jul 25th 2017, 11:01 |
neon1024 |
Not all RFC’s get supported |
# |
Jul 25th 2017, 11:01 |
neon1024 |
You need to stay involved with the discussion. |
# |
Jul 25th 2017, 11:01 |
inoas |
anyway |
# |
Jul 25th 2017, 11:01 |
inoas |
and (even if PSR7 says otherwise) there is no reason to prefix get to get values out of a immutable object |
# |
Jul 25th 2017, 11:00 |
inoas |
you would ue with to clone - all good |
# |
Jul 25th 2017, 11:00 |
neon1024 |
As with PSR7 |
# |
Jul 25th 2017, 11:00 |
neon1024 |
No, you’d use with |