"Adding New Content Types to Sculpin" whateverthing.com/blog/2019/02

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".

PHP question: Why can't traits have constants?

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.

Ah, solved (but still worrying): the website mistakenly tried to load a resource from localhost. That makes sense, since I had a server running on port 80.

Had. 😰

... I swear I just visited a website and it triggered xdebug in phpstorm. That's ... uh ... not good. For several reasons.

Although now I'm seeing some coverage gaps - like I'm not sure how to handle the ->error() stuff. Perhaps with middleware.

Wrote this Silex to Slim quick port guide almost a year ago and, sure enough, it's coming in handy again. :)

whateverthing.com/blog/2018/05

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.

github.com/tootsuite/mastodon/

PHP question: It looks like it's possible to "use", and therefore alias, a namespaced constant. Is there any way to do the same thing with a namespaced class constant?

Every time I hear about the "jamf" tool for corporate device management. Every time.

I live near two harbours, so I occasionally get to hear boat toots. Today is such a day. Toot. Toot.

Oh, and because python on macOS is a hot mess, I had to create a custom SSL context that disabled peer verification. What is this, 2009?

Wrote a short python script for a friend this evening. Python 3, of course. It makes multiple API requests and merges the results into a single list, then outputs as JSON. Good way to practice with a language I'm not fully proficient in.

I deactivated my Instagram and Facebook. Haven't deleted them, yet, but it's a start.

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.

Last night: Successfully patching a Roku app (at least enough to start a PR).

Tonight: Maybe finishing up the details necessary to try launching Sculpin 3. I kind of think I've been procrastinating on it in order to avoid embarrassing myself (or, worse, breaking people's sites).

Show more
PHP Community on Mastodon

Open source. Open community. We are dedicated to building and enriching the PHP community. Join us!

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."