Skip to content

Instantly share code, notes, and snippets.

@rskuipers
Created August 31, 2016 10:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rskuipers/66c2b8e85c733915d38184aa7e40ee91 to your computer and use it in GitHub Desktop.
Save rskuipers/66c2b8e85c733915d38184aa7e40ee91 to your computer and use it in GitHub Desktop.
<?php
// This file is not a CODE, it makes no sense and won't run or validate
// Its AST serves IDE as DATA source to make advanced type inference decisions.
namespace PHPSTORM_META {
$STATIC_METHOD_TYPES = [
\Zend\ServiceManager\ServiceLocatorInterface::get('') => [
// STATIC call key to make static (1) & dynamic (2) calls work
"special" instanceof \Exception,
// "KEY" instanceof Class maps KEY to Class
],
];
}
@Ocramius
Copy link

Note: this can be used also with any PSR-11 container 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment