{@inheritdoc}

@throws InvalidArgumentException
777328
public function create(string $resourceClass, array $options = []): PropertyNameCollection
    {
        $propertyNames = [];
        $propertyNameCollection = null;

        if ($this->decorated) {
            try {
                $propertyNameCollection = $this->decorated->create($resourceClass, $options);
            } catch (ResourceClassNotFoundException $resourceClassNotFoundException) {
                // Ignore not found exceptions from parent
            }

            foreach ($propertyNameCollection as $propertyName) {
                $propertyNames[$propertyName] = $propertyName;
            }
        }

        if (!class_exists($resourceClass)) {
            if (null !== $propertyNameCollection) {
                return $propertyNameCollection;
            }

            throw new ResourceClassNotFoundException(sprintf('The resource class "%s" does not exist.', $resourceClass));
        }

        if ($properties = $this->extractor->getResources()[$resourceClass]['properties'] ?? false) {
            foreach ($properties as $propertyName => $property) {
                $propertyNames[$propertyName] = $propertyName;
            }
        }

        return new PropertyNameCollection(array_values($propertyNames));
    }
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));
    }
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.");
			}
		}
	}
178283
public function setName(string $name): void
	{
		if ($name === '') {
			throw new InvalidArgumentException;
		}
		if (Strings::match($name, '/[^A-Za-z0-9_]/')) {
			throw new InvalidArgumentException('Name contains invalid characters');
		}

		/* @var $repository AclRolesRepository */
		$repository = $this->getRepository();
		$role = $repository->getByName($name);
		if ($role !== null && $role !== $this) {
			throw new UniqueConstraintViolationException("Role '$name' exists");
		}
		$this->name = $name;
	}
60331
public function handle(CommandInterface $command)
    {
        if (!$this->supports(get_class($command))) {
            throw new InvalidArgumentException(
                sprintf(
                    'The command must be an instance of "%s". "%s" given.',
                    $this->getSupportedCommandClassName(),
                    get_class($command)
                )
            );
        }

        return $this->execute($command);
    }
1038046
public function offsetSet($offset, $argument)
    {
        if (!is_null($offset) && !is_scalar($offset)) {
            throw new InvalidArgumentException('scalar', 0);
        }

        if (!$argument instanceof TokenInterface) {
            throw new InvalidArgumentException('TokenInterface', 1);
        }

        if (!in_array($argument, $this->children)) {
            $this->children[$offset] = $argument;
        }
    }
1176625
public function execute(InputInterface $input, OutputInterface $output)
    {
        if (($destPath = $input->getOption('dest-path')) === null) {
            $destPath = 'config';
        }

        if (($author = $input->getArgument('author')) === null) {
            throw new InvalidArgumentException('Missing author option');
        }

        if (($sourceFilePath = $input->getOption('source-file')) === null) {
            $sourceFilePath = 'config/doctrine.php';
        }

        $destPath = realpath($destPath);

        if (!is_dir($destPath)) {
            mkdir($destPath, 0777, true);
        }

        if (!is_writable($destPath)) {
            throw new InvalidArgumentException(
                sprintf("Configuration destination directory '<info>%s</info>' does not have write permissions.",
                    $destPath)
            );
        }

        $destFilePath = $destPath . '/doctrine.generated.php';

        $originalSourceFilePath = $sourceFilePath;
        $sourceFilePath         = realPath($sourceFilePath);

        if (!file_exists($sourceFilePath)) {
            throw new InvalidArgumentException(
                sprintf("Source file at path '<info>%s</info>' does not exist.",
                    $originalSourceFilePath)
            );
        }

        $sourceArrayConfig = include $sourceFilePath;

        $viewFactory = $this->createViewFactory();

        $className = __NAMESPACE__ . '\ConfigMigrations\\' . ucfirst($author) . 'Migrator';

        if (!class_exists($className)) {
            throw new InvalidArgumentException('Author provided was not a valid choice.');
        } else {
            $configMigrator        = new $className($viewFactory);
            $convertedConfigString = $configMigrator->convertConfiguration($sourceArrayConfig);
        }

        file_put_contents($destFilePath, '<?php ' . $convertedConfigString);

        $output->writeln('Conversion successful. File generated at ' . $destFilePath);
    }
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 ?? '')
        ;
    }
1365028
protected function execute(InputInterface $input, OutputInterface $output): void
    {
        // Throw an exception immediately if we don't have the required DB parameter
        if (empty($input->getOption('db'))) {
            throw new \InvalidArgumentException('Database name is required (--db)');
        }

        $password = $input->getOption('password');
        if (null === $password) {
            $question = new Question('Password: ');
            $question->setHidden(true)->setHiddenFallback(false);

            $password = $this->getHelper('question')->ask($input, $output, $question);
        }

        $ignoreFields = $input->getOption('ignore-field');


        $this->dbUtils->configure([
            'driver' => $input->getOption('driver'),
            'host' => $input->getOption('host'),
            'dbname' => $input->getOption('db'),
            'user' => $input->getOption('user'),
            'password' => $password,
        ]);

        $writer = new \Edyan\Neuralyzer\Configuration\Writer;
        $writer->protectCols($input->getOption('protect'));

        // Override the protection if fields are defined
        if (!empty($ignoreFields)) {
            $writer->protectCols(true);
            $writer->setProtectedCols($ignoreFields);
        }

        $writer->setIgnoredTables($input->getOption('ignore-table'));
        $data = $writer->generateConfFromDB($this->dbUtils, new \Edyan\Neuralyzer\Guesser);
        $writer->save($data, $input->getOption('file'));

        $output->writeln('<comment>Configuration written to '.$input->getOption('file').'</comment>');
    }
213811
public function setPathBuilder($pathBuilder, array $options = []) {
		if (is_string($pathBuilder)) {
			$this->_pathBuilder = $this->createPathBuilder($pathBuilder, $options);

			return;
		}

		if (!$pathBuilder instanceof PathBuilderInterface) {
			throw new InvalidArgumentException(sprintf('The first arg does not implement %s', PathBuilderInterface::class));
		}

		$this->_pathBuilder = $pathBuilder;
	}
976111
public function offsetSet($offset, $value) {

		if (is_null($offset)) {
			throw new \InvalidArgumentException('Invalid NULL offset. Only named offsets allowed.');
		}
		$this->values[$offset] = $value;

	}
383221
public function add($child, $type, array $execOptions = array(), array $initOptions = array())
    {
        if (!is_string($child) && !is_int($child)) {
            throw new \InvalidArgumentException(sprintf('child name should be string or, integer'));
        }

        if (null !== $type && !is_string($type) && !$type instanceof JobTypeinterface) {
            throw new \InvalidArgumentException('type should be string or JobTypeinterface');
        }

        $this->children[$child] = null; // to keep order
        $this->unresolvedChildren[$child] = array(
            'type' => $type,
            'init_options' => $initOptions,
            'exec_options' => $execOptions
        );

        return $this;
    }
221302
protected function initialize(InputInterface $input, OutputInterface $output)
    {

        parent::initialize($input, $output);

        $translationMode = $input->getOption('mode');
        $validModes      = array(
            'reviewed',
            'translated',
            'default'
        );
        if (!in_array($translationMode, $validModes)) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Invalid translation mode %s specified. Must be one of %s',
                    $translationMode,
                    implode(', ', $validModes)
                )
            );
        }
    }
495896
public function offsetSet($offset, $value)
    {
        $this->checkType($value);
        if ($offset != $value->name()) {
            throw new InvalidArgumentException("The offset has to be the name of the constraint");
        }
        $this->constraints[$value->name()] = $value;
    }
904945
protected function checkValueStructure(BaseValue $value)
    {
        // Input file URI, if set needs to point to existing file
        if (isset($value->inputUri)) {
            if (!file_exists($value->inputUri)) {
                throw new InvalidArgumentValue(
                    '$value->inputUri',
                    $value->inputUri,
                    get_class($this)
                );
            }
        } elseif (!isset($value->id)) {
            throw new InvalidArgumentValue(
                '$value->id',
                $value->id,
                get_class($this)
            );
        }

        // Required parameter $fileName
        if (!isset($value->fileName) || !is_string($value->fileName)) {
            throw new InvalidArgumentValue(
                '$value->fileName',
                $value->fileName,
                get_class($this)
            );
        }

        // Optional parameter $fileSize
        if (isset($value->fileSize) && !is_int($value->fileSize)) {
            throw new InvalidArgumentValue(
                '$value->fileSize',
                $value->fileSize,
                get_class($this)
            );
        }
    }
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');
	}
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];
    }