Create a new instance of matcher.

@param string|object $type The type to check against.

@return Matcher The newly created matcher.
553650
public function anInstanceOf($type): Matcher
    {
        if (is_object($type)) {
            $type = get_class($type);
        }

        return new InstanceOfMatcher($type);
    }
379074
public function make( $type )
    {
        $type = __NAMESPACE__ . "\\" . $type;
        if (class_exists( $type )) {
            /**
             * @var \Lti\Seo\Generators\Thing $object
             */
            $object = new $type( $this->helper );
            $result = $object->format();
            if (is_array( $result ) && ! empty( $result )) {
                return json_encode( array_merge( array( '@context' => 'http://schema.org' ), $result ) );
            }
        }

        return null;
    }
1015183
public static function create($name, $type = NULL, $defaultValue = self::UNDEFINED, $modifiers = self::MODIFIER_PROTECTED) {
    if (isset($type)) {
      if ($type instanceof GClass) {
        $type = new ObjectType(new GClass($type->getFQN()));
      } elseif (!($type instanceof Type)) {
        $type = Type::create($type);
      }
    }
    
    return new static($name, $type, $defaultValue, $modifiers);
  }
1211511
public function make(string $type)
    {
        if (isset($this->iocContainerArray[$type])) {
            $type = $this->iocContainerArray[$type];

            return $type();
        }
        throw new ClientException('No type registered with that name');
    }
828101
public function getElementInstance($type)
	{
		$class = $this->elementNamespace . ucfirst($type);

		if (array_key_exists($type, $this->customTypes))
		{
			$class = $this->customTypes[$type];
		}

		// TODO: Throw exception if the class cannot be found
		return new $class;
	}
576236
static public function instance($type=null)
    {
        $type = $type ?: 'default';
        if (!isset(static::$instances[$type])) {
            $options = ['type' => $type];
            static::$instances[$type] = new static($options);
        }
        return static::$instances[$type];
    }
161009
public function setType($type): self
    {
        if ($type instanceof Type) {
            $this->setIndex($type->getIndex()->getName());
            $type = $type->getName();
        }
        $this->_metadata['_type'] = $type;

        return $this;
    }
1064346
public function createType($type): CastInterface
    {
        $result = null;
        if (\is_callable($type)) {
            $result = new TypeClosure($type);
        } elseif (\in_array($type, Cast::TYPES, true)) {
            switch ($type) {
                case Cast::INT:
                    $result = new TypeInt();
                    break;
                case Cast::BOOL:
                    $result = new TypeBool();
                    break;
                case Cast::FLOAT:
                    $result = new TypeFloat();
                    break;
                case Cast::STRING:
                    $result = new TypeString();
                    break;
                case Cast::BINARY:
                    $result = new TypeBinary();
                    break;
                case Cast::OBJECT:
                    $result = new TypeObject();
                    break;
                case Cast::UNSET:
                    $result = new TypeUnset();
                    break;
                case Cast::ARRAY:
                    $result = new TypeArray();
                    break;
            }
        } elseif ($type instanceof CastInterface) {
            $result = $type;
        }

        if ($result === null) {
            throw new Exception('Type not found');
        }

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

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

    return $this;
  }
1321784
public function getType($type)
    {
        if (!$this->hasType($type)) {
            $this->metaTypeList[$type] = new $type();
        }

        return $this->metaTypeList[$type];
    }
104962
static public function createObject($type, array $config = [])
	{
		if (is_string($type)) {
			return static::container()->get($type, $config);
		} elseif (is_array($type) && isset($type['class'])) {
			$class = $type['class'];
			unset($type['class']);
			if ($config) $type = array_merge($type, $config); 
			return static::container()->get($class, $type);
		} elseif (is_callable($type, false)) {
			return call_user_func($type, $config);
		} elseif (is_object($type)) {
			return $type;
		} elseif (is_array($type)) {
			throw new InvalidConfigException('object configuration must be an array containing a "class" element.');
		} else {
			throw new InvalidConfigException("Unsupported configuration type: " . gettype($type));
		}
	}
996465
public static function getInstance($type)
    {
        self::checkType($type);

        if (!isset(self::$instances[$type])) {
            self::$instances[$type] = new \Tx_Oelib_Session($type);
        }

        return self::$instances[$type];
    }
1046498
protected function createProperty($type)
    {
        return $this->getSchema()->getFactory()->createProperty(
            [ 'type' => $type, 'name' => $this->getName().'_item', 'required' => true ],
            $this->getSchema(),
            $this
        );
    }
880387
public static function input(string $type)
    {
        $self = self::$input[$type] ?? new self;

        self::$input[$type] = $self;

        switch (strtoupper($type)) {
            case 'GET':
            case 'POST':
                $self->params = filter_input_array(constant('INPUT_' . $type)) ?? [];
                break;
            case 'PUT':
            case 'DELETE':
                $self->params = self::getParsedInput();
                break;
        }

        return function ($key = null) use ($self) {
            $self->key = $key;

            return $self;
        };
    }
1020910
public function setType(Type $type = null)
    {
        if ($this->type !== $type) {
            $this->type = $type;
        }

        return $this;
    }
261736
public function setType(?string $type): self
    {
        $this->type                          = $this->validateType($type);
        $this->type_hint || $this->type_hint = $this->type;

        return $this;
    }
433227
private function setType(string $type): self
    {
        switch ($type) {
            case 'navigator.id.getAssertion': // fall through
            case 'navigator.id.finishEnrollment':
                break;
            default:
                throw new IDE(IDE::MALFORMED_DATA, 'typ');
        }
        $this->typ = $type;
        return $this;
    }