Returns a new instance of ModeInterface.

@return ModeInterface

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

        switch ($this->type) {
            case 'nginx':
            case 'sendfile':
            case 'xaccel':
            case 'xaccelredirect':
            case 'x-accel':
            case 'x-accel-redirect':
                if (2 >= count($this->mapping)) {
                    $this->logger->error('Invalid xsendfile mapping configuration.');
                    if ($throwException) {
                        throw new RuntimeException('Mapping is not set up.');
                    }
                }

                return new NginxMode($this->mapping);
            case 'apache':
            case 'apache2':
            case 'xsendfile':
                return new ApacheMode($this->mapping);
            default:
                $this->logger->error('Invalid xsendfile type configuration.');
                if ($throwException) {
                    throw new InvalidArgumentException(sprintf(
                        'Invalid xsendfile type value "%s"',
                        $this->type
                    ));
                }

                return new NullMode();
        }
    }
197978
public function getInstantiator(): Instantiator
    {
        if (is_null($this->instantiator)) {
            $this->setInstantiator(new Instantiator(null, $this));
        }

        return $this->instantiator;
    }
45094
public static function getInstance()
    {
        static $_instance;

        if (!$_instance) {
            $_instance = new self(new AnConfig(array('service_container' => AnService::getInstance())));
            AnService::set('plg:contentfilter.chain', $_instance);
            AnService::get('com:plugins.helper')->import('contentfilter');
        }

        return $_instance;
    }
1345835
public function newInstance()
    {
        /** @noinspection PhpUnusedLocalVariableInspection */
        $name = "{$this->getMockNamespaceName()}\\{$this->getMockName()}";
        /** @noinspection PhpUnusedLocalVariableInspection */
        $code = $this->generateCode();
        /** @var $reflect \ReflectionClass */
        $reflect = eval("$code return new \\ReflectionClass('$name');");

        try {
            return $reflect->newInstanceArgs($this->constructorArgs);
        } catch (ReflectionException $e) {
            return $reflect->newInstance();
        }
    }
671892
public function create()
    {
        $instance = self::createReturnLineItem($this);
        $this->setId($instance->getId());
        return $instance;
    }
364288
public function setMode($mode)
    {
        if (!in_array($mode, [self::MODE_AND, self::MODE_OR])) {
            throw new InvalidArgumentException("Invalid mode $mode");
        }
        $this->mode = $mode;

        return $this;
    }
137062
public function createIngestClient() {

    $config = $this->configFactory->get('acm.connector');
    if (!strlen($config->get('url_ingest'))) {
      throw new \InvalidArgumentException('No Commerce Connector Service URL specified.');
    }

    $clientConfig = [
      'base_uri' => $config->get('url_ingest'),
      'timeout'  => (int) $config->get('timeout'),
      'verify'   => (bool) $config->get('verify_ssl'),
    ];

    return $this->clientFactory->fromOptions($clientConfig);
  }
962728
public static function instance(): self
    {
        if (!self::$instance) {
            self::$instance = new self(
                InvocableInspector::instance(),
                Invoker::instance()
            );
        }

        return self::$instance;
    }
739786
public static function instance(): self
    {
        if (!self::$instance) {
            self::$instance = new self(
                MatcherVerifier::instance(),
                InlineExporter::instance(),
                DifferenceEngine::instance(),
                FeatureDetector::instance()
            );
        }

        return self::$instance;
    }
1278041
public function module($module)
    {
        if (is_object($module)) {
            if (!($module instanceof ModuleInterface)) {
                $moduleType = get_class($module);

                throw new InvalidArgumentException("Given module object '$moduleType' does not implement 'Depend\\Abstraction\\ModuleInterface'");
            }

            $module->register($this);

            return $this;
        }

        if (!class_exists((string) $module)) {
            throw new InvalidArgumentException("Given class name '$module' could not be found");
        }

        return $this->module(new $module);
    }
314304
public function setDefaultMode(string $mode = null) : RauthInterface
    {
        if (!in_array($mode, self::MODES)) {
            throw new \InvalidArgumentException(
                'Mode ' . $mode . ' not accepted!'
            );
        }
        $this->defaultMode = $mode;

        return $this;
    }
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;
    }
997107
public function setMode($mode)
    {
        if ($mode === null) {
            $this->mode = $mode;
            return $this;
        }

        if (!is_string($mode)) {
            throw new InvalidArgumentException(
                'Order Mode must be a string.'
            );
        }

        $mode  = strtolower($mode);
        $valid = $this->validModes();
        if (!in_array($mode, $valid)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid Order Mode. Must be one of "%s"',
                implode('", "', $valid)
            ));
        }

        if (in_array($mode, [ self::MODE_ASC, self::MODE_DESC ])) {
            $this->setDirection($mode);
        }

        $this->mode = $mode;
        return $this;
    }
1315235
public function getSource()
    {
        if (!isset($this->config['source'])) {
            throw new InvalidArgumentException('A "source" file system must be set.');
        }

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

        return $this->config['source'];
    }
643640
public function create($mode = 0777) {

		if(false === ('-' . intval($mode) == '-' . $mode)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($mode)), E_USER_ERROR);
		}

		$paths = preg_split('#[\\/]#', $this -> directory -> getPath());
		$build = '';

		foreach($paths as $path) {

			$build .= $path . DIRECTORY_SEPARATOR;

			if(false === @is_dir($build)) {
				@mkdir($build, $mode);
			}
		}

		$this -> refresh();

		return $this;
	}
1036428
public function create($type)
    {
        if (!is_string($type) && !($type instanceof LdapObjectSchema)) {
            throw new InvalidArgumentException(
                'You must either pass the schema object type as a string to this method, or pass the schema types '
                . 'LdapObjectSchema to this method.'
            );
        }
        if (!($type instanceof LdapObjectSchema)) {
            $type = $this->schemaFactory->get($this->connection->getConfig()->getSchemaName(), $type);
        }
        $this->schema = $type;
        $this->container = $type->getDefaultContainer();

        return $this;
    }
763394
public function getResolver()/*# : ParameterInterface */
    {
        if (!$this->hasResolver()) {
            throw new NotFoundException(
                Message::get(Message::PARAM_RESOLVER_MISS),
                Message::PARAM_RESOLVER_MISS
            );
        }
        return $this->resolver;
    }