src/Eloquent/Typhoon/Generator/TyphaxASTGenerator.php
public function visitResourceType(ResourceType $type)
    {
        $this->typeCheck->visitResourceType(func_get_args());

        $isResourceCall = new Call(QualifiedIdentifier::fromString('\is_resource'));
        $isResourceCall->add($this->valueExpression());

        if (null === $type->ofType()) {
            return $isResourceCall;
        }

        $getResourceTypeCall = new Call(QualifiedIdentifier::fromString('\get_resource_type'));
        $getResourceTypeCall->add($this->valueExpression());

        return new LogicalAnd(
            $isResourceCall,
            new StrictEquals(
                $getResourceTypeCall,
                new Literal($type->ofType())
            )
        );
    }
public function visitResourceType(ResourceType $type)
    {
        $this->typeCheck->visitResourceType(func_get_args());

        $isResourceCall = new Call(QualifiedIdentifier::fromString('\is_resource'));
        $isResourceCall->add($this->valueExpression());

        if (null === $type->ofType()) {
            return $isResourceCall;
        }

        $getResourceTypeCall = new Call(QualifiedIdentifier::fromString('\get_resource_type'));
        $getResourceTypeCall->add($this->valueExpression());

        return new LogicalAnd(
            $isResourceCall,
            new StrictEquals(
                $getResourceTypeCall,
                new Literal($type->ofType())
            )
        );
    }
@param ResourceType $type

@return Call|LogicalAnd