{ PHP snippets }

Jason McCreary

Jason McCreary @gonedark

@jesseschutt Well, since you asked, here's my take on a few of the ways you could handle this… On first pass, I use the "Separate Assignment". But may end up with the "Explicit Calls" (when it's simple) or "Refactor" (when it's complex). ? https://t.co/aHFwoBFp8I

PHP
Philipp Kühn ??‍♂️

Philipp Kühn ??‍♂️ @_philippkuehn

@adamwathan funfact: you can also use collect() to pass data to vue. a bit shorter ? <user-profile :user="{{ collect($user) }}"></user-profile>

Adam Wathan

Adam Wathan @adamwathan

? I hate NounVerber classes but if I *have to* extract a single behavior because it needs to be swappable, I like making it invokable and thinking of it as a callback instead of a real "object". Make it way easier to name too ?? https://t.co/MGgAMkeFK9

PHP
Jason McCreary

Jason McCreary @gonedark

? Naming things is most certainly hard. I find full names aimed at relaying a human context yield the most readable code. Here are a few examples to help make naming things a little easier… https://t.co/U2AhdaSwUb

PHP
John T. Bonaccorsi

John T. Bonaccorsi @imjohnbon

? Easy way to improve code clarity: use the JSON_OBJECT_AS_ARRAY predefined constant to make the second parameter of json_decode human readable. https://t.co/Jm9XzlYgS2

PHP
Chris Fidao

Chris Fidao @fideloper

? Don't forget to index timestamp columns like "created_at" if you query against them. e.g.: ORDER BY created_at e.g.: WHERE published_at <= NOW() https://t.co/z8Jt4xMQTj

PHP
Jason McCreary

Jason McCreary @gonedark

A few ways to clean up the conditional code that forms most of your codebase. From simple to nested to spotting unnecessary conditions. ? https://t.co/qGVaDl3TKt

PHP