{@inheritDoc}

@throws \InvalidArgumentException When the extractor can not be found.
10883
public function get(string $path, array $row): ?string
    {
        if (!array_key_exists($this->colName, $row) || (null === $row[$this->colName])) {
            return null;
        }
        $content = $this->decode($row[$this->colName]);
        $chunks  = explode('.', $path);

        if (!array_key_exists($chunks[0], $content)) {
            return null;
        }

        if (null === ($extractor = $this->extractors[$chunks[0]] ?? null)) {
            throw new \InvalidArgumentException('Sub extractor ' . $chunks[0] . ' not found');
        }

        switch (true) {
            case $extractor instanceof MultiStringExtractorInterface:
                return $extractor->get(substr($path, (\strlen($chunks[0]) + 1)), $content);
            case $extractor instanceof StringExtractorInterface:
                return $extractor->get($content);
            default:
        }
    }
510535
public function canExtract($source, $target, ExtractionContextInterface $extractionContext)
    {
        if (!$target instanceof SupportedTarget) {
            return false;
        }

        if (is_null(self::getPrimitiveType($source))) {
            return false;
        }

        return true;
    }
614014
protected function extract()
    {
        $this->output->writeln(" Preparing project...\n");

        try {
            $distill = new Distill();
            $extractionSucceeded = $distill->extractWithoutRootDirectory($this->downloadedFilePath, $this->projectDir);
        } catch (FileCorruptedException $e) {
            throw new \RuntimeException(sprintf(
                "%s can't be installed because the downloaded package is corrupted.\n".
                "To solve this issue, try executing this command again:\n%s",
                ucfirst($this->getDownloadedApplicationType()), $this->getExecutedCommand()
            ));
        } catch (FileEmptyException $e) {
            throw new \RuntimeException(sprintf(
                "%s can't be installed because the downloaded package is empty.\n".
                "To solve this issue, try executing this command again:\n%s",
                ucfirst($this->getDownloadedApplicationType()), $this->getExecutedCommand()
            ));
        } catch (TargetDirectoryNotWritableException $e) {
            throw new \RuntimeException(sprintf(
                "%s can't be installed because the installer doesn't have enough\n".
                "permissions to uncompress and rename the package contents.\n".
                "To solve this issue, check the permissions of the %s directory and\n".
                "try executing this command again:\n%s",
                ucfirst($this->getDownloadedApplicationType()), getcwd(), $this->getExecutedCommand()
            ));
        } catch (\Exception $e) {
            throw new \RuntimeException(sprintf(
                "%s can't be installed because the downloaded package is corrupted\n".
                "or because the installer doesn't have enough permissions to uncompress and\n".
                "rename the package contents.\n".
                "To solve this issue, check the permissions of the %s directory and\n".
                "try executing this command again:\n%s",
                ucfirst($this->getDownloadedApplicationType()), getcwd(), $this->getExecutedCommand()
            ), null, $e);
        }

        if (!$extractionSucceeded) {
            throw new \RuntimeException(sprintf(
                "%s can't be installed because the downloaded package is corrupted\n".
                "or because the uncompress commands of your operating system didn't work.",
                ucfirst($this->getDownloadedApplicationType())
            ));
        }

        return $this;
    }
1204717
protected function checkAndExtractModelFile()
    {
        if (!is_readable($file = $this->argument('modelfile'))) {
            throw new \InvalidArgumentException('Could not find the model.');
        } // if

        $archive = new \ZipArchive();

        if (!$archive->open(realpath($file))) {
            throw new \InvalidArgumentException('Could not open the model.');
        } // if

        $dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid() . DIRECTORY_SEPARATOR;

        if (!$archive->extractTo($dir)) {
            throw new \InvalidArgumentException('Could not extract the model.');
        } // if

        return $dir;
    }
844171
protected function _extract() {
		$message = [];

		$message[] = 'A `Catalog` class configuration with an adapter that is capable of';
		$message[] = 'handling read requests for the `messageTemplate` category is needed';
		$message[] = 'in order to proceed. This may also be referred to as `extractor`.';
		$this->out($message);
		$this->out();

		$name = $this->_configuration([
			'adapter' => 'Code',
			'path' => $this->source,
			'scope' => $this->scope
		]);
		$configs = Catalog::config();

		try {
			return Catalog::read($name, 'messageTemplate', 'root', [
				'scope' => $configs[$name]['scope'],
				'lossy' => false
			]);
		} catch (Exception $e) {
			return false;
		}
	}
1071376
public function get($name)
    {
        if (!isset($this->helpers[$name])) {
            throw new \InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name));
        }

        return $this->helpers[$name];
    }
1317660
public function on($resource)
    {
        if (!$this->runnable()) {
            throw new \InvalidArgumentException('Command execution is restricted.');
        }

        if (is_array($resource)) {
            return $this->executeOnMulitpleResources($resource);
        }

        return $this->executeOn($resource);
    }
162426
public function getCompactors()
    {
        $compactors = array();

        if (isset($this->raw->compactors)) {
            foreach ((array) $this->raw->compactors as $class) {
                if (false === class_exists($class)) {
                    throw new InvalidArgumentException(
                        sprintf(
                            'The compactor class "%s" does not exist.',
                            $class
                        )
                    );
                }

                $compactor = new $class();

                if (false === ($compactor instanceof CompactorInterface)) {
                    throw new InvalidArgumentException(
                        sprintf(
                            'The class "%s" is not a compactor class.',
                            $class
                        )
                    );
                }

                if ($compactor instanceof Php) {
                    if (!empty($this->raw->annotations)) {
                        $tokenizer = new Tokenizer();

                        if (isset($this->raw->annotations->ignore)) {
                            $tokenizer->ignore(
                                (array) $this->raw->annotations->ignore
                            );
                        }

                        $compactor->setTokenizer($tokenizer);
                    }
                }

                $compactors[] = $compactor;
            }
        }

        return $compactors;
    }
329494
protected function extractTokens($value)
    {
        if (empty($value)) {
            throw new InvalidArgumentException('DateRangeParser: Value can\'t be empty');
        }

        $operation = substr($value, 0, 1);

        if ($operation === '!') {
            $this->operation = 'not between';
            $value           = substr($value, 1);
        }

        $dateTimes = explode(',', $value);

        $this->from = $dateTimes[0];
        $this->to   = $dateTimes[1];
    }
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.");
			}
		}
	}
1113969
public function setExtractFlags($flag)
    {
        switch ($flag) {
            case self::EXTR_DATA:
            case self::EXTR_PRIORITY:
            case self::EXTR_BOTH:
                $this->extractFlag = $flag;
                break;
            default:
                throw new Exception\InvalidArgumentException("The extract flag specified is not valid");
        }
    }
370060
public function extractArchive($archive, $destination)
    {
        if (!file_exists($archive)) {
            throw new \InvalidArgumentException("Archive not found: $archive");
        }
        if (!file_exists($destination) && !mkdir($destination, 0755, true)) {
            throw new \InvalidArgumentException("Could not create destination directory: $destination");
        }
        $tar = $this->getTarExecutable();
        $destination = $this->fixTarPath($destination);
        $archive = $this->fixTarPath($archive);
        $this->shell->execute([$tar, '-xzp', '-C' . $destination, '-f' . $archive], null, true);
    }
334809
public function hydrate($value)
    {
        if ($this->nullable && $value === null) {
            return null;
        }
        
        if ($value instanceof MongoBinData) {
            return $value->bin;
        }
        
        throw new Exception\InvalidArgumentException(sprintf(
            'Invalid value: must be an instance of MongoBinData, "%s" given',
            is_object($value) ? get_class($value) : gettype($value)
        ));
    }
842662
public function url($body, array $extractors = [])
    {
        // An extractor is a class that can parse some string and return a canonical url.
        // If you aren't doing anything special, you don't need to pass in any. We include
        // sane defaults for you. You might, however, want to prioritize the order the tags
        // are parsed and so you might pass in a set of extractors to use instead.
        if (!$extractors || !is_array($extractors)) {
             $extractors = $this->defaultExtractors();
        }

        // We'll try each extractor until we find one that returns a url
        foreach ($extractors as $extractor) {
            $url = $extractor->url($body);

            if ($url) {
                return $url;
            }
        }

        // If we can't find anything, we'll just return false
        return false;
    }
349191
public function buildDescriptor($data)
    {
        $assembler = $this->getAssembler($data);
        if (!$assembler) {
            throw new \InvalidArgumentException(
                'Unable to build a Descriptor; the provided data did not match any Assembler '. get_class($data)
            );
        }

        if ($assembler instanceof Builder\AssemblerAbstract) {
            $assembler->setBuilder($this);
        }

        // create Descriptor and populate with the provided data
        $descriptor = $assembler->create($data);
        if (!$descriptor) {
            return null;
        }

        $descriptor = (!is_array($descriptor) && (!$descriptor instanceof Collection))
            ? $this->filterAndValidateDescriptor($descriptor)
            : $this->filterAndValidateEachDescriptor($descriptor);

        return $descriptor;
    }
443579
public function extract($value)
    {
        if (!$value instanceof Money) {
            throw new \InvalidArgumentException(sprintf(
                '$value expected type SCL\Currency\Money, got "%s"',
                is_object($value) ? get_class($value) : gettype($value)
            ));
        }

        return $value->getValue();
    }
267792
public function extract($object)
    {
        if (!$object instanceof CountryEntityInterface) {
            throw new Exception\InvalidArgumentException('$object must be an instance of DelCountriesFlags\Entity\CountryInterface');
        }
        /* @var $object CountryInterface*/
        $data = parent::extract($object);
        return $data;
    }