Added sniff that detects if an entity implements the automatically generated interface

Also made the project compatible with PHP 5.4 again
Be careful that you re-assign a function argument here, is that desired behavior?