I've just seen a #programming pattern in #PHP where a method could return two lists of things. Instead of doing that, it takes as a parameter a callable, and passes the two lists to the callable. Instead of:
[$a, $b] = getLists($param);
// Act on both lists.
we have:
$callable = function($a, $b) {
// Act on both lists
}
actOnLists($param, $callable);
If you haven't picked up a free copy of my book, Mastering Object-Oriented PHP, make sure you head over to https://masteringobjectorientedphp.com and get your copy today! Free is my way of giving back to the PHP community.
The life of a maintainer (and generally any back-end engineer) - if your existence is acknowledged, something's probably gone wrong! I feel you, @jrf_nl
Thank you to all of the package maintainers out there 💕
discovered livetechhelper.com, while the initiative could be positive explained, the execution is horrible! I found https://livetechhelper.com/repos/jaapio/phpunit
I can help with #phpunit but obviously any income should go to the original maintainers not to me because I created a fork!
Same applies to other projects, should we stop this?! #php#foss?
I found myself needing to write tests for code that throw an exception with domain-specific information. I actually need access to the exception thrown in my test. So, I created a testing utility that will do just that.
@tjventurini Depends… PHPStorm for laravel and other framework projects. VS Code for small single file scripts, or small frameworkless projects and testing quick one offs. No reason you can’t use both right?