PHPExiftool\Reader::extensions PHP Method

extensions() public method

Restrict / Discard files based on extensions Extensions are case insensitive
public extensions ( string | array $extensions, boolean $restrict = true ) : Reader
$extensions string | array The list of extension
$restrict boolean Toggle restrict/discard method
return Reader
    public function extensions($extensions, $restrict = true)
    {
        $this->resetResults();
        if (!is_null($this->extensionsToggle)) {
            if ((bool) $restrict !== $this->extensionsToggle) {
                throw new LogicException('You cannot restrict extensions AND exclude extension at the same time');
            }
        }
        $this->extensionsToggle = (bool) $restrict;
        $this->extensions = array_merge($this->extensions, (array) $extensions);
        return $this;
    }