Phpro\SoapClient\CodeGenerator\Rules\TypenameMatchesRule::appliesToContext PHP Method

appliesToContext() public method

public appliesToContext ( Phpro\SoapClient\CodeGenerator\Context\ContextInterface $context ) : boolean
$context Phpro\SoapClient\CodeGenerator\Context\ContextInterface
return boolean
    public function appliesToContext(ContextInterface $context)
    {
        if (!$context instanceof TypeContext && !$context instanceof PropertyContext) {
            return false;
        }
        $type = $context->getType();
        if (!preg_match($this->regex, $type->getName())) {
            return false;
        }
        return $this->subRule->appliesToContext($context);
    }