seems $app is an object with at least the register() method .. I propose to either use type hinting or a verification that $app is of the instance of this specific class. Probably beberlei/assert is a good choise for the latter ;)