"Adding New Content Types to Sculpin" https://whateverthing.com/blog/2019/02/09/adding-new-content-types-to-sculpin/ #php #sculpin
In this post, I use Sculpin 3.0-RC1's new "content:create" command to add a dedicated section for Short Stories to my blog. I'm calling the new feature "Tales from the Whateverthing".
I wrote a service class that accepts an integer ID and returns an entity (basically an entity repository). But I'm torn on how it should behave if the provided ID is invalid - e.g., a string. Should it throw an exception? Should it return null? Should it use type hinting to enforce the contract & force the controller to sort it out? Yeah, probably that one. Erph.
"Porting Silex web apps to the Slim #PHP Framework, Round 2"
Wrote this Silex to Slim quick port guide almost a year ago and, sure enough, it's coming in handy again. :)
Heh. There's a PR on the mastodon project for supporting code blocks in the Formatter:
// you know, like this
$myVariable = 'why is it still in PR?';
... and it seems to be languishing. Tempted to poke it, but I find working with Ruby a bit quarrelsome.
Hi, yes, hi. I just spent an hour trying to figure out why cURL was giving me zero data back despite CURLOPT_RETURNTRANSFER being set to true.
Well, guess what?
CURLOPT_NOBODY was ALSO set to true.
I should've just pulled in a library. Unfortunately, I don't think any libraries offer the other functionality I need for this hobby project.
A sailboat would be nice, too. https://www.flickr.com/photos/beryllium/32885449308
Welcome to the PHP Community on Mastodon! We're a friendly little Mastodon instance providing a place for PHP developers to discuss topics related to PHP, as well as topics unrelated to PHP. First and foremost, we're about building community, and that doesn't always involve technical discussion, so feel free to go off-topic and have fun.
Before you get started, make sure you check out our code of conduct.
Thank you to Jakob Westhoff for allowing the use of the photograph "elePHPants walking through the light."