public function __construct(array $methods, array $traitMethods)
{
$this->methodNames = array();
$this->allMethods = $methods;
$this->traitMethods = $traitMethods;
$this->staticMethods = array();
$this->methods = array();
$this->publicStaticMethods = array();
$this->publicMethods = array();
$this->protectedStaticMethods = array();
$this->protectedMethods = array();
foreach ($methods as $name => $method) {
$this->methodNames[strtolower($name)] = $name;
$isStatic = $method->isStatic();
$accessLevel = $method->accessLevel();
$isPublic = 'public' === $accessLevel;
if ($isStatic) {
$this->staticMethods[$name] = $method;
if ($isPublic) {
$this->publicStaticMethods[$name] = $method;
} else {
$this->protectedStaticMethods[$name] = $method;
}
} else {
$this->methods[$name] = $method;
if ($isPublic) {
$this->publicMethods[$name] = $method;
} else {
$this->protectedMethods[$name] = $method;
}
}
}
}