{ PHP snippets }

Paul Redmond ??

Paul Redmond ?? @paulredmond

? If you're application is behind a proxy/load balancer, you can force HTTPS at the web server level by checking the X-Forwarded-Proto header https://t.co/oomJNOWNUe

PHP
Jason McCreary

Jason McCreary @gonedark

? Pushing yourself to remove comments is one of the best drivers towards clean code. Here's a few tips on how to spot and replace comments that may be unnecessary… https://t.co/STIK6AIKXt

PHP
Frank de Jonge

Frank de Jonge @frankdejonge

Small #PHP tip: Want to before sure multiple keys of an array are set? Define them in one isset() call, it's so much clearer! if ( ! isset($a['q']) || ! isset($a['w']) || ! isset($a['e'])) { // PANIC } # Becomes if ( ! isset($a['q'], $a['w'], $a['e'])) { // OH NO! }

PHP

The --stop-on-failure flag has been of great help to stop my test suite once it finds a failing test. Pretty useful for large suites where you don't want to spend 2 minutes waiting to know what the failure is about (+300 tests in my case). ? https://t.co/uJOFFyeovO

PHP
Achraf Kassioui

Achraf Kassioui @achrafkassioui

CSS tip: the <main> element isn't recognized as a default block level element in Internet Explorer. Set it to display: block in CSS so IE can display it correctly.

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