@param string $type

@return TypeDoc|null
550096
private function normalizeType(string $type) : ?TypeDoc
    {
        if (array_key_exists($type, self::MANAGED_TYPE_CLASS_LIST)) {
            $class = self::MANAGED_TYPE_CLASS_LIST[$type];

            return new $class();
        }

        return null;
    }
1110693
protected function valType($type)
    {
        $type = IriFactory::create($type);

        return strlen($type->name) ? $type : null;
    }
740965
public function getType($type)
    {
        $type = ltrim($type, '\\');
        if (isset($this->classes[$type])) {
            return $this->classes[$type];
        } elseif (isset($this->interfaces[$type])) {
            return $this->interfaces[$type];
        } elseif (isset($this->traits[$type])) {
            return $this->traits[$type];
        }

        return null;
    }
779471
public function setObjectType($type)
    {
        if (!is_null($type)) {
            $type = (string) $type;
        }

        $this->objectType = $type;
        return $this;
    }
755631
public static function getType($type)
    {
        if (!isset(static::$mappedTypeInstances[$type])) {
            if (!static::hasType($type)) {
                throw TypeException::typeDoesNotExist($type);
            }

            static::$mappedTypeInstances[$type] = new static::$mappedTypeClasses[$type]();
        }

        return static::$mappedTypeInstances[$type];
    }
1004720
public static function getArrayType(string $type): ?string
    {
        if (substr($type, -2) !== '[]' || strlen($type) === 2) {
            return null;
        }

        return substr($type, 0, -2);
    }
1055617
public function getExampleByType($type)
    {
        return isset($this->bodyList[$type]['example']) ? $this->bodyList[$type]['example'] : null;
    }
1194423
public function type($type = null) {
		if ($type === false) {
			unset($this->headers['Content-Type']);
			$this->_type = false;
			return;
		}
		$media = $this->_classes['media'];

		if (!$type && $this->_type) {
			return $this->_type;
		}
		$headers = $this->headers + ['Content-Type' => null];
		$type = $type ?: $headers['Content-Type'];

		if (!$type) {
			return;
		}
		$header = $type;

		if (!$data = $media::type($type)) {
			$this->headers('Content-Type', $type);
			return ($this->_type = $type);
		}
		if (is_string($data)) {
			$type = $data;
		} elseif (!empty($data['content'])) {
			$header = is_string($data['content']) ? $data['content'] : reset($data['content']);
		}
		$this->headers('Content-Type', $header);
		return ($this->_type = $type);
	}
1029683
public function getNextOfType($type)
    {
        for (; $this->idx < $this->count; ++$this->idx) {
            if ($this->tokens[$this->idx]->type === $type) {
                return $this->tokens[$this->idx++];
            }
        }

        return null;
    }
604442
public function all($type = null)
    {
        return array_filter(
            $this->bag,
            /** @var BuilderInterface $builder */
            function (BuilderInterface $builder) use ($type) {
                return $type === null || $builder->getType() == $type;
            }
        );
    }
1095423
public function setType( $type )
    {
        $this->type = is_int( $type ) ? $type : self::getStorableType( $type );
        return $this;
    }
1004438
public function getItemClass($type = null)
    {
        $type = $type ? $type : $this->getDefaultValue();

        return $this->getPropertyItemsRootNamespace() . inflector()->classify($type);
    }
694060
protected function _getMethodNameForType($type = null) {
		$result = '_getValueForString';
		if (empty($type)) {
			return $result;
		}

		$type = mb_strtolower($type);
		$methodName = '_getValueFor' . Inflector::camelize($type);
		if (method_exists($this, $methodName)) {
			$result = $methodName;
		}

		return $result;
	}
538281
public function returnType($type = null)
  {
    if (null === $type)
    {
      return $this->responseConfig['returnType'];
    }

    $this->responseConfig['returnType'] = $type;

    return $this;
  }
326707
public function type($type = null)
    {
        if (!func_num_args()) {
            return $this->_type;
        }
        $this->_type = $type;
        return $this;
    }
744133
public function getEncoderForType(string $type): IEncoder
    {
        $normalizedType = self::normalizeType($type);

        if (isset($this->encodersByType[$normalizedType])) {
            return $this->encodersByType[$normalizedType];
        }

        if (class_exists($type)) {
            if ($this->defaultObjectEncoder === null) {
                throw new OutOfBoundsException('No default object encoder is registered');
            }

            return $this->defaultObjectEncoder;
        }

        if ($this->defaultScalarEncoder === null) {
            throw new OutOfBoundsException('No default scalar encoder is registered');
        }

        return $this->defaultScalarEncoder;
    }
19062
public function getComponentByType($type)
    {
        foreach ($this->components as $component) {
            if ($component instanceof $type) {
                return $component;
            }
        }
        return null;
    }