/**
  * @param ObjectType $type
  *
  * @return Call|InstanceOfType
  */
 public function visitObjectType(ObjectType $type)
 {
     $this->typeCheck->visitObjectType(func_get_args());
     if (null === $type->ofType()) {
         $call = new Call(QualifiedIdentifier::fromString('\\is_object'));
         $call->add($this->valueExpression());
         return $call;
     }
     return new InstanceOfType($this->valueExpression(), QualifiedIdentifier::fromString($type->ofType()->string()));
 }
 /**
  * Visit an object type.
  *
  * @param ObjectType $type The type.
  *
  * @return mixed The result of visitation.
  */
 public function visitObjectType(ObjectType $type)
 {
     if (null !== $type->ofType()) {
         return $type->ofType();
     }
     return 'object';
 }