{@inheritdoc}

@throws \Symfony\Component\Console\Exception\InvalidArgumentException
495421
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $table = new Table($output);
        $table->setRows([
            ['Classes: ', $this->metrics->classCount($this->dependencies)],
            ['Abstract classes: ', $this->metrics->abstractClassCount($this->dependencies)],
            ['Interfaces: ', $this->metrics->interfaceCount($this->dependencies)],
            ['Traits: ', $this->metrics->traitCount($this->dependencies)],
            ['Abstractness: ', sprintf('%.3f', $this->metrics->abstractness($this->dependencies))],
        ]);
        $table->render();

        $table = new Table($output);
        $table->setHeaders(['', 'Afferent Coupling', 'Efferent Coupling', 'Instability']);
        $table->setRows($this->combineMetrics(
            $this->metrics->afferentCoupling($this->dependencies),
            $this->metrics->efferentCoupling($this->dependencies),
            $this->metrics->instability($this->dependencies)
        ));
        $table->render();
    }
962314
public function relationshipValue($key)
    {
        if (!isset($this->keyToIndexMap[$key]) || !$this->values[$this->keyToIndexMap[$key]] instanceof Relationship) {
            throw new \InvalidArgumentException(sprintf('value for %s is not of type %s', $key, 'RELATIONSHIP'));
        }

        return $this->value($key);
    }
422917
public function add($value)
    {
        if ( ! is_scalar($value)) {
            throw new InvalidArgumentException(sprintf(
                'Argument 1 passed to %s must be a scalar value, %s given',
                __METHOD__,
                is_object($value) ? get_class($value) : gettype($value)
            ));
        }

        parent::offsetSet(null, $value);
    }
226329
public function setValues($values)
    {
        if ((null !== $values) && (false === is_array($values))) {
            if (false === ($values instanceof ArrayAccess)) {
                throw new InvalidArgumentException(
                    'The value of $values is not an array or an instance of ArrayAccess.'
                );
            }
        }

        $this->values = $values;
    }
596553
public function execute($one = false, $scalar = false, $preserveKeys = false)
    {
        if (true === $scalar && (count($this->select) > 1 || true === isset($this->select['*']))) {
            throw new \InvalidArgumentException('$scalar can only be true if only one field is selected.');
        }

        $result = [];

        foreach ($this->from as $key => $item) {
            if (true === $this->evaluateWhere($item)) {
                $resultItem = $this->evaluateSelect($item, $scalar);

                if (true === $one) {
                    return $resultItem;
                }

                if ($preserveKeys) {
                    $result[$key] = $resultItem;
                }
                else {
                    $result[] = $resultItem;
                }
            }
        }

        return $result;
    }
536131
public function offsetSet($offset, $value): void
    {
        if ($this->isValidEntity($value)) {
            if (is_null($offset) || mb_strlen($offset) == 0) {
                $this->list[] = $value;
            } else {
                $this->list[$offset] = $value;
            }
        } else {
            throw new \InvalidArgumentException(sprintf('This collection does\'t accept this entity "%s"', gettype($value)));
        }
    }
904386
public function set($key, $value)
    {
        if (!is_string($key)) {
            throw new \InvalidArgumentException('Expected string as key');
        }

        if (!is_string($value)) {
            throw new \InvalidArgumentException('Expected string as value');
        }

        $queryString = 'REPLACE INTO ' . $this->name . ' VALUES (:key, :value);';
        $stmt = $this->db->prepare($queryString);
        $stmt->bindParam(':key', $key, \PDO::PARAM_STR);
        $stmt->bindParam(':value', $value, \PDO::PARAM_STR);
        $stmt->execute();
        $this->data[(string)$key] = $value;

        return $this->data[$key];
    }
1019309
public function registerProcessor(string $class, string $processorClass): void
    {
        if (! (new \ReflectionClass($processorClass))->implementsInterface(ProcessorInterface::class)) {
            throw InvalidArgumentException::create(InvalidArgumentException::INVALID_PROCESSOR_INTERFACE_CLASS, $processorClass);
        }

        if (! isset($this->processors[$class])) {
            $this->processors[$class] = $processorClass;
        } elseif (! is_array($this->processors[$class])) {
            $this->processors[$class] = [$this->processors[$class], $processorClass];
        } else {
            $this->processors[$class][] = $processorClass;
        }
    }
1097127
public function fn($id, $callable = null, $needsContainer = false)
    {
        if ($callable === null) {
            $callable = $id;
        }
        if (!is_callable($callable)) {
            throw new \InvalidArgumentException("Not callable");
        }
        $this->set($id, array($callable, $needsContainer));
    }
674986
public function setAccessorOrder($order, array $customOrder = []): void
    {
        if (! \in_array($order, [self::ACCESSOR_ORDER_UNDEFINED, self::ACCESSOR_ORDER_ALPHABETICAL, self::ACCESSOR_ORDER_CUSTOM], true)) {
            throw new InvalidArgumentException(\sprintf('The accessor order "%s" is invalid.', $order));
        }

        foreach ($customOrder as $name) {
            if (! \is_string($name)) {
                throw new InvalidArgumentException(\sprintf('$customOrder is expected to be a list of strings, but got element of value %s.', \var_export($name, true)));
            }
        }

        $this->accessorOrder = $order;
        $this->customOrder = \array_flip($customOrder);
        $this->sortProperties();
    }
811950
protected function getConfig($key = null)
    {
        if ($this->config === null) {
            $this->setConfig();
        }

        if (null === $key) {
            return $this->config;
        }

        if (!array_key_exists($key, $this->config)) {
            throw new InvalidArgumentException("key: '" . $key . "' is not set in configuration options.");
        }

        return $this->config[$key];
    }
1019510
public function setConst(string $const): void
	{
		if (!$this->locale) {
			throw new InvalidArgumentException('Locale must be set before calling setConst');
		}
		if (Strings::match($const, '/[^A-Za-z0-9_]/')) {
			throw new InvalidArgumentException('Constant contains invalid characters');
		}

		/* @var $repository ContentRepository */
		$repository = $this->getRepository();
		$content = $repository->getByConst($const, $this->locale->name);
		if ($content !== null && $content !== $this) {
			throw new UniqueConstraintViolationException("Content with '$const' exists");
		}
		$this->const = $const;
	}
505664
public function setClient()
    {
        if(empty($this->apiKey))
        {
            throw new InvalidArgumentException('Api key can not be empty');
        }

        $this->client = new Client($this->apiKey);
    }
557728
private function initTransports()
    {
        $this->transports = array();

        foreach ($this->loadTransports() as $transport) {
            if (!$transport instanceof TransportInterface) {
                throw new \InvalidArgumentException(sprintf('Transport %s should implements TransportInterface', get_class($transport)));
            }

            $this->transports[$transport->getName()] = $transport;
        }
    }
1129839
public function initialize()
    {
        if (!file_exists($this->paramsPathname)) {
            throw new \InvalidArgumentException("Invalid Magento root '$this->magentoRoot'.");
        }

        $params = $this->getParams();
        $params['code'] = $this->store;
        $params['type'] = $this->scope;
        $this->saveParams($params);
    }
566369
public function populate($row): void
    {
        if (is_array($row)) {
            $row = (object) $row;
        }

        $requiredFields = ['countryCode', 'vatNumber', 'requestDate', 'valid'];
        foreach ($requiredFields as $requiredField) {
            if (! isset($row->$requiredField)) {
                throw new InvalidArgumentException('Required field "' . $requiredField . '" is missing');
            }
        }

        $this
            // required parameters
            ->setCountryCode($row->countryCode)
             ->setVatNumber($row->vatNumber)
             ->setRequestDate($row->requestDate)
             ->setValid($row->valid)
            // optional parameters
            ->setName($row->traderName ?? '---')
            ->setAddress($row->traderAddress ?? '---')
            ->setIdentifier($row->requestIdentifier ?? '')
            ->setNameMatch($row->traderNameMatch ?? '')
            ->setCompanyTypeMatch($row->traderCompanyTypeMatch ?? '')
            ->setStreetMatch($row->traderStreetMatch ?? '')
            ->setPostcodeMatch($row->traderPostcodeMatch ?? '')
            ->setCityMatch($row->traderCityMatch ?? '')
        ;
    }
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'];
	}