Hellenic Bank Open API

Oh. My. God.  The future is here.  Hellenic Bank is (finally!) introducing an API.  Not sure yet what exactly one would be able to do with it, but even if it’s just to check an account balance, it’s progress already.

I vaguely remember being part of the effort to convince Hellenic Bank (or any Cyprus bank for that matter) to provide an API to my then employer … erm … about 10 years ago.  The effort was beyond describable at the time.  But I knew the day would come, and it’s finally here.

These are probably the biggest technology news since the time PrimeTel became an ISP with its own submarine cables.

Dependency Management and WordPress: A Proposal

I came across this article – “Dependency Management and WordPress: A Proposal“, which provides an excellent overview of some of the recent developments and discussions in the area of composer integration with WordPress, and even more generically, some of the issues around dependency management in an ecosystem as large and complex as that of WordPress.

It’s been a while since I checked what’s going on in this area.  A couple of years back, I linked to an article that shows a way to use composer with WordPress, and since then I’ve built something similar for our use at work.

But it’s good to see that the problem is not tossed and forgotten, and that there are some very smart people still trying to work it out.

Payum – PHP 5.5+ payment processing library

Payum – PHP 5.5+ payment processing library, which is self-described as:

It offers everything you need to work with payments: Credit card & offsite purchasing, subscriptions, payouts etc.

The documentation looks extensive, and the list of supported gateways is probably the longest I’ve seen.

Creating Strictly Typed Arrays and Collections in PHP

This SitePoint PHP blog post (read at Planet PHP if the site is unavailable) brings to light a very useful feature available since PHP 5.6 – ellipses in functional arguments, which allows to define a variable number of arguments to a function.

I’ve seen the mentions of ellipses a few times now, but I assumed that it was a PHP 7 feature.  Turns out PHP 5.6 users can enjoy it as well:

<?php
function sum(...$numbers) {
    $acc = 0;
    foreach ($numbers as $n) {
        $acc += $n; 
    }   
    return $acc;
}
echo sum(1, 2, 3, 4); // prints out 10

This is very useful, but, as SitePoint PHP blog most mentions, it can be made even more useful with type hinting of the arguments.  For example:

<?php 
class Movie { private $dates = [];
    public function setAirDates(\DateTimeImmutable ...$dates) { 
        $this->dates = $dates;
    }   

    public function getAirDates() {
        return $this->dates;
    }   
}

The limitation is that you can only hint a single type for all the arguments. The workaround this is to use collection classes, which basically work as strictly typed arrays.

Shields.io – quality metadata badges for open source projects

Shields.io provides a large collection of badges that you can use in your project documentation (like README.md over at GitHub or BitBucket), which shows a variety of metrics for the project – latest version, number of downloads, build status, and more.  Pretty much anything that you’ve seen used by any project on GitHub is supported (I couldn’t think of a badge that wasn’t).

Now, if only there was a way to insert these things automatically somehow …