Class Ando_Function for PHP

EDIT: https://github.com/aercolino/ando-php

This is a simple class for creating generic callbacks in PHP. There are a couple of reasons for using this class instead of the usual ´array( $container, $function )´ method.

First, the usual method doesn’t allow you to run the called code with more arguments than those provided by the calling code.

Second, this class resolves to the usual method when no extra arguments are provided, thus making it transparent at run time. This could seem useless, but, for free, we get much easier to spot callback calling points.

{[ .class-func | 1.hilite(=php=) ]}

Here are some tests.

{[ .tests | 1.hilite(=php=) ]}

Screen Shot 2014-10-28 at 16.53.43

(previous permalink: class-func-for-php)

How to autocomplete PHPUnit in VVV using PHPStorm 8

First install phpunit.phar locally:

$ brew update
Updated Homebrew from b1001942 to 3a44ae38.
...

$ brew install phpunit
==> Installing phpunit from homebrew/homebrew-php
==> Downloading https://phar.phpunit.de/phpunit-4.3.4.phar
######################################################################## 100,0%
🍺  /usr/local/Cellar/phpunit/4.3.4: 3 files, 3,2M, built in 3 seconds

Then right-click on the External Libraries entry in the Project pane and choose Configure PHP include paths…

Then add an include path to the folder where phpunit.phar is installed:

Screen Shot 2014-10-27 at 1.11.25

And finally you get all completions:

Screen Shot 2014-10-27 at 1.18.02