PHP-FIG

PSR-14: Being a good Provider

Submitted by Larry on 30 March 2019 - 11:00am

As mentioned back in part 1, PSR-14 splits the core mediator into two objects: The Dispatcher and the Provider. The Dispatcher is fairly straightforward and most implementations will be fairly simple and fairly similar.

Providers are the exact opposite; A Listener Provider has one requirement: It maps the Event object into an iterable of callables, in the order it chooses. How it does that is left up to the Provider to define, and there are dozens of possible ways.

Continue reading this post on SteemIt.

PSR-14: All about Events

Submitted by Larry on 28 March 2019 - 11:03am

In the last installment we discussed the overall structure of PSR-14. Today I'd like to dive into the key aspect of any event system: The Events themselves.

Various different event systems structure events in different ways. Some require that it be an object. Others it's any arbitrary value. Others it's any number of arbitrary values, depending on the Event. Some really really want pass-by-reference arrays.

For PSR-14, we chose to standardize on an object and always an object. There were three main reasons for that:

Continue reading this post on SteemIt.

PSR-14: A Major Event in PHP

Submitted by Larry on 26 March 2019 - 10:44am

The PHP Framework Interoperability Group has released a number of new specifications in the last year. The latest, PSR-14, covers Event Dispatching. Like many PSRs it's a fairly small spec, at the end of the day, but intended to be high-impact.

In this series of posts I want to cover what PSR-14 is and does (and what it isn't and doesn't), and how to best leverage it in your projects as it gets deployed more widely.

Continue reading this post on SteemIt.

Announcing API Problem 3.x for PHP, complete with PSR-17 support

Submitted by Larry on 24 November 2018 - 6:06pm

After a longer than intended delay, I'm happy to announce the 3.0 release of my Crell/ApiProblem library.

ApiProblem is a small, self-contained library for modeling IETF RFC 7807 "Problem Details" messages. (I know, more gibberish.) That is, it makes it easier for PHP developers to build a message for their API servers to handle cases where Something Bad Happened(tm).

Continue reading this post on SteemIt

The next era of PHP

Submitted by Larry on 30 May 2015 - 5:57pm

2015 is turning into a watershed year for PHP. Many projects either have or will release new major versions, including Zend Framework, Symfony, Laravel, Guzzle, Drupal, Slim, and many others. And of course there's PHP 7 itself, coming this fall.

I'll talk more on those later, but for the moment I want to focus on one other major new development this year: PSR-7.