Zephir\ClassMethod::areReturnTypesNullCompatible PHP Method

areReturnTypesNullCompatible() public method

Checks whether at least one return type hint is null compatible
public areReturnTypesNullCompatible ( string $type = null ) : boolean
$type string
return boolean
    public function areReturnTypesNullCompatible($type = null)
    {
        if (count($this->returnTypes)) {
            foreach ($this->returnTypes as $returnType => $definition) {
                switch ($returnType) {
                    case 'null':
                        return true;
                }
            }
        }
        return false;
    }