Returns a new instance of H264Interface.

@return H264Interface

@throws InvalidArgumentException if mode type is unknown
776718
public function createMode($throwException = false, $forceMode = false)
    {
        if (false === $this->enabled && true !== $forceMode) {
            return new NullMode();
        }

        switch ($this->type) {
            case 'apache':
            case 'apache2':
                return new Apache($this->mapping);
            case 'nginx':
                return new Nginx($this->mapping);
            default:
                $this->logger->error('Invalid h264 pseudo streaming configuration.');
                if ($throwException) {
                    throw new InvalidArgumentException(sprintf('Invalid h264 pseudo streaming configuration width type "%s"', $this->type));
                }

                return new NullMode();
        }
    }
495758
static function getInstance()
    {
        $driver = static::getLibrary();

        try {
            $instance = new $driver();
        } catch (\Exception $e) {
            throw new Exception('Unable to create an instance of ' . $driver);
        }

        if (!self::isInstanceOf($instance, CryptInterface::class)) {
            throw new Exception(Exception::MSG_INVALID_ARG, ['driver', CryptInterface::class]);
        }

        return $instance;
    }
372871
public function getCache()
    {
        if (!isset($this->config['cache'])) {
            throw new InvalidArgumentException('A "cache" file system must be set.');
        }

        if (is_string($this->config['cache'])) {
            return new Filesystem(
                new Local($this->config['cache'])
            );
        }

        return $this->config['cache'];
    }
247172
public function build(): ResolveAnimationRequest
	{
		$instance = new ResolveAnimationRequest();
		if ($this->animationId === null) {
			throw new BuilderException('Property [animationId] is required.');
		}
		$instance->animationId = $this->animationId;
		return $instance;
	}
577059
public static function instance($type)
    {
        if (!is_int($type)) {
            throw new \InvalidArgumentException(sprintf('Record type id must be an integer, %s given', gettype($type)));
        }

        // @codeCoverageIgnoreStart
        if (!self::$instances) {
            self::$instances = [
                self::BEGIN_REQUEST     => new self(self::BEGIN_REQUEST),
                self::ABORT_REQUEST     => new self(self::ABORT_REQUEST),
                self::END_REQUEST       => new self(self::END_REQUEST),
                self::PARAMS            => new self(self::PARAMS),
                self::STDIN             => new self(self::STDIN),
                self::STDOUT            => new self(self::STDOUT),
                self::STDERR            => new self(self::STDERR),
                self::DATA              => new self(self::DATA),
                self::GET_VALUES        => new self(self::GET_VALUES),
                self::GET_VALUES_RESULT => new self(self::GET_VALUES_RESULT),
                self::UNKNOWN_TYPE      => new self(self::UNKNOWN_TYPE),
            ];
        }
        // @codeCoverageIgnoreEnd

        if ($type >= self::MAXTYPE || $type <= 0) {
            $type = self::UNKNOWN_TYPE;
        }

        return self::$instances[$type];
    }
901331
public static Iso8601UtilLimited getInstance() {

    if (instance == null) {
      synchronized (Iso8601UtilLimitedImpl.class) {
        if (instance == null) {
          instance = new Iso8601UtilLimitedImpl();
        }
      }
    }
    return instance;
  }
763394
public function getResolver()/*# : ParameterInterface */
    {
        if (!$this->hasResolver()) {
            throw new NotFoundException(
                Message::get(Message::PARAM_RESOLVER_MISS),
                Message::PARAM_RESOLVER_MISS
            );
        }
        return $this->resolver;
    }
398404
public function build(): SetCustomObjectFormatterEnabledRequest
	{
		$instance = new SetCustomObjectFormatterEnabledRequest();
		if ($this->enabled === null) {
			throw new BuilderException('Property [enabled] is required.');
		}
		$instance->enabled = $this->enabled;
		return $instance;
	}
896090
public function build()
    {
        $mapping = $this->mapping;
        if ($this->joinColumns) {
            $mapping['joinColumns'] = $this->joinColumns;
        }
        $cm = $this->builder->getClassMetadata();
        if ($this->type == ClassMetadata::MANY_TO_ONE) {
            $cm->mapManyToOne($mapping);
        } else if ($this->type == ClassMetadata::ONE_TO_ONE) {
            $cm->mapOneToOne($mapping);
        } else {
            throw new \InvalidArgumentException("Type should be a ToOne Association here");
        }
        return $this->builder;
    }
187538
public static function instance(): self
    {
        if (!self::$instance) {
            self::$instance = new self(
                InvocableInspector::instance(),
                FunctionSignatureInspector::instance(),
                FunctionHookGenerator::instance()
            );
        }

        return self::$instance;
    }
965831
public function withNotModified()
    {
        $new = $this->withStatus(304);
        $new->_createStream();
        $remove = [
            'Allow',
            'Content-Encoding',
            'Content-Language',
            'Content-Length',
            'Content-MD5',
            'Content-Type',
            'Last-Modified'
        ];
        foreach ($remove as $header) {
            $new = $new->withoutHeader($header);
        }

        return $new;
    }
990625
static public function create()
    {
        $t = new static();

        $t->registerService(new Service\Youtube());
        $t->registerService(new Service\Dailymotion());
        $t->registerService(new Service\Vimeo());
        $t->registerService(new Service\Spotify());
        $t->registerService(new Service\SoundCloud());

        return $t;
    }
299775
public function getModel()
    {
        if(!$this->_model instanceof KModelInterface)
        {
            if(!($this->_model instanceof KObjectIdentifier)) {
                $this->setModel($this->_model);
            }

            $this->_model = $this->getObject($this->_model);

            if(!$this->_model instanceof KModelInterface)
            {
                throw new UnexpectedValueException(
                    'Model: '.get_class($this->_model).' does not implement KModelInterface'
                );
            }
        }

        return $this->_model;
    }
1209594
public function createNew()
    {
        $resource = $this->traitCreateNew();

        if (!$resource instanceof TranslatableInterface) {
            throw new \InvalidArgumentException('Resource must implement TranslatableInterface.');
        }

        $resource->setCurrentLocale($this->localeProvider->getCurrentLocale());
        $resource->setFallbackLocale($this->localeProvider->getFallbackLocale());

        return $resource;
    }
875931
public static function getInstance()
    {
        if (!self::$instance instanceof ClientInterface) {

            $serviceContainer = ServiceContainer::getInstance();

            self::$instance = new static(
                $serviceContainer->get('engine'),
                $serviceContainer->get('procedure_loader'),
                $serviceContainer->get('procedure_compiler'),
                $serviceContainer->get('message_factory')
            );
        }

        return self::$instance;
    }
451012
public function build(): GetResponseBodyForInterceptionRequest
	{
		$instance = new GetResponseBodyForInterceptionRequest();
		if ($this->interceptionId === null) {
			throw new BuilderException('Property [interceptionId] is required.');
		}
		$instance->interceptionId = $this->interceptionId;
		return $instance;
	}
971961
public static function create(): GUID
    {
        $guid = \random_bytes(16);

        // Reset version byte to version 4 (0100)
        $guid[6] = chr(ord($guid[6]) & 0x0f | 0x40);

        $guid[8] = chr(ord($guid[8]) & 0x3f | 0x80);

        return new static($guid);
    }