{@inheritdoc}
@throws \InvalidArgumentException
495034
public function uSort($cmp_function)
    {
        if (!is_callable($cmp_function)) {
            throw new \InvalidArgumentException(
                'Callback is not callable.',
                E_USER_ERROR
            );
        }

        return usort($this->storedData, $cmp_function);
    }
424073
public function &__get($key)
    {
        if (!isset($this->service[$key])) {
            throw new InvalidArgumentException(sprintf('Value "%s" is not defined.', $key));
        }

        return
            isset($this->service[$key]) &&
            is_callable($this->service[$key]) ?
                $this->service[$key]($this) :
                $this->service[$key];
    }
398047
public function add($key)
    {
        if (is_null($key)) {
            throw new InvalidArgumentException("Can't add NULL {$this->name}.");
        }

        if ($key instanceof Eloquent) {
            $key = $key->getAttribute('name');
        }

        if ($this->has($key)) {
            return false;
        }

        array_push($this->items, $this->getSlugFromName($key));

        return true;
    }
1301485
public function handleOpen(string $fileName): void
	{
		if (strpos($fileName, '..' . DIRECTORY_SEPARATOR) !== false) {
			throw new InvalidArgumentException;
		}
		$file = $this->getFileInfo($fileName);
		if ($file->isDir) {
			$path = $this->getPath();
			$path[] = $fileName;
			$this->setPath($path);
		} else {
			$this->viewFile($file);
		}

		$this->redrawControl('fileManagerContainer');
	}
960682
public function execute($options = [])
    {
        if (! is_array($options) && ! $options instanceof Option) throw new \InvalidArgumentException('invalid option');
        if (! $this->do) throw new \Samurai\Samurai\Exception\LogicException('preset task something do.');

        $option = $this->getOption($this->do);
        if (is_array($options)) {
            $option->importFromArray($options);
        } else {
            $option->import($options);
        }
        $option->validate();
        $this->{$this->do . 'Task'}($option);
    }
270246
public function setValue($value)
    {
        if (\is_string($value)) {
            $this->value = $value;
        } elseif (\is_object($value) && $value instanceof self) {
            $this->value = $value->getValue();
        }

        throw new \InvalidArgumentException('Expected string');
    }
331466
public function init()
    {
        $extensions = [];

        if (empty($this->extensionClasses) && empty($this->userConfig)) {
            return;
        }

        foreach ($this->extensionClasses as $extensionClass) {
            if (!class_exists($extensionClass)) {
                throw new \InvalidArgumentException(sprintf(
                    'Extension class "%s" does not exist',
                    $extensionClass
                ));
            }

            $extension = new $extensionClass();

            if (!$extension instanceof ExtensionInterface) {
                throw new \InvalidArgumentException(sprintf(
                    // add any manually specified extensions
                    'Extension "%s" must implement the PhpBench\\Extension interface',
                    get_class($extension)
                ));
            }

            $extensions[] = $extension;

            $this->config = array_merge(
                $this->config,
                $extension->getDefaultConfig()
            );
        }

        $diff = array_diff(array_keys($this->userConfig), array_keys($this->config));

        if ($diff) {
            throw new \InvalidArgumentException(sprintf(
                'Unknown configuration keys: "%s". Permitted keys: "%s"',
                implode('", "', $diff), implode('", "', array_keys($this->config))
            ));
        }

        $this->config = array_merge(
            $this->config,
            $this->userConfig
        );

        foreach ($extensions as $extension) {
            $extension->load($this);
        }
    }
1316678
public function extractArgs($args)
	{
		foreach ($args as $k => $v) {
			if (property_exists($this, $k)) {
				$this->$k = $v;
			} else {
				throw new \InvalidArgumentException("{$k} is not a valid option.");
			}
		}
	}
105659
public function execute( $query ) {
		if ( $query instanceof QueryBuilder ) {
			$query = $query->getSPARQL();
		}

		if ( !is_string( $query ) ) {
			throw new InvalidArgumentException( '$query has to be a string or an instance of QueryBuilder' );
		}

		$result = $this->getResult( $query );
		
		// TODO also support ask queries (with key 'boolean')
		//      https://www.w3.org/TR/rdf-sparql-json-res/
		return $result['results'];
	}
909052
public function setValue($value)
    {
        if (is_array($value)) {
            if (1 === count($value)) {
                $this->value = $value[0];
            } else {
                throw new \InvalidArgumentException('The argument must either be a string or an array with only one child');
            }
        } else {
            $this->value = $value;
        }
    }
974621
protected function setQuery($query)
    {
        if (is_array($query)) {
            $query = http_build_query($query);
        }
        
        if (!$this->isValidQuery($query)) {
            throw new \InvalidArgumentException("Invalid query '$query'");
        }
        
        $this->query = (string)$query;
    }
402732
protected function initInstances()
    {
        if (empty($this->instances)) {
            foreach ($this->servers as $server) {
                if ($server instanceof \Redis) {
                    if ($server->isConnected()) {
                        $redis = $server;
                    } else {
                        throw new \InvalidArgumentException("If you use \\Redis objects as argument, the object must be connected.");
                    }
                } else {
                    if (empty($server[0])) {
                        throw new \InvalidArgumentException("A server hostname or IP is required");
                    }

                    if (empty($server[1])) {
                        $server[1] = 6379;
                    }
                    if (empty($server[2])) {
                        $server[2] = 0;
                    }
                    list($host, $port, $timeout) = $server;
                    $redis = new \Redis();
                    $redis->connect($host, $port, $timeout);
                }
                $this->instances[] = $redis;
            }
        }
    }
902630
public function getArgument($key)
    {
        if ($this->hasArgument($key)) {
            return $this->arguments[$key];
        }

        throw new \InvalidArgumentException(sprintf('%s not found in %s', $key, $this->getName()));
    }
656677
public function call()
    {
        $host = $this->getHost();
        if (!$host || empty($host)) {
            throw new InvalidArgumentException('Host não informado');
        }

        $service = $this->getService();
        if (!$service || empty($service)) {
            throw new InvalidArgumentException('Serviço não informado');
        }

        $request = $this->getRequest();
        if (!$request || empty($request)) {
            throw new InvalidArgumentException('Request não informada');
        }

        $this->connect();
        $client = $this->getClient();

        return $client->__soapCall($service, $request);
    }
1156676
public function addInstaller(InstallerInterface $installer)
    {
        $installerClass = get_class($installer);

        if (!isset($this->installers[$installerClass])) {
            if ($installer instanceof OrderedInstallerInterface && $installer instanceof DependentInstallerInterface) {
                throw new \InvalidArgumentException(sprintf('Class "%s" can\'t implement "%s" and "%s" at the same time.',
                    $installerClass,
                    'OrderedInstallerInterface',
                    'DependentInstallerInterface'));
            } elseif ($installer instanceof OrderedInstallerInterface) {
                $this->orderInstallersByNumber = true;
            } elseif ($installer instanceof DependentInstallerInterface) {
                $this->orderInstallersByDependencies = true;
                foreach ($installer->getDependencies() as $class) {
                    $this->addInstaller(new $class);
                }
            }

            $this->installers[$installerClass] = $installer;
        }
    }
385504
public function get($key)
    {
        if ($this->has($key)) {
            return $this->params[$key];
        }

        throw new \InvalidArgumentException(sprintf("Config key %s doest not exist", $key));
    }
1073772
public function setMethod($method)
    {
        $method = (string) $method;
        if ($method === '') {
            throw new \InvalidArgumentException('$method cannot be empty');
        }

        $this->method = $method;
    }