protected function checkWrappers(int $options)
    {
        $hasWrappers = $this->getPathInfo()
                            ->hasWrappers();
        if (($options & self::WRAPPER_DISABLED) && $hasWrappers) {
            $mess = 'Given wrapper when wrapper(s) are disabled';
            throw new \DomainException($mess);
        }
        if (($options & self::WRAPPER_REQUIRED) && !$hasWrappers) {
            $mess = 'Missing wrapper when wrapper(s) are required';
            throw new \DomainException($mess);
        }
        $wrappers = $this->getPathInfo()
                         ->getWrapperList();
        $hasVfs = \in_array('vfs', $wrappers, true);
        if (($options & self::VFS_DISABLED) && $hasVfs) {
            $mess = 'Found vfsStream wrapper when it was disabled';
            throw new \DomainException($mess);
        }
        if (($options & self::VFS_REQUIRED) && !$hasVfs) {
            $mess = 'Missing vfsStream wrapper when it was required';
            throw new \DomainException($mess);
        }
        /*
         * Though technically allowed duplicate wrappers are most likely to be
         * user errors, programming bugs, or at least a bad programming smell.
         */
        if (\count($wrappers) !== \count(\array_unique($wrappers))) {
            $mess = 'Duplicate wrappers are not allowed';
            throw new \DomainException($mess);
        }
        $regExp = '%^[[:alpha:]][[:alnum:]]+$%';
        if (false === \array_reduce($wrappers, function ($carry, $item) use ($regExp) {
                return $carry && \preg_match($regExp, $item);
            }, true)
        ) {
            $mess = 'Invalidly formatted wrapper name found';
            throw new \DomainException($mess);
        }
        $last = \array_pop($wrappers);
        if ($hasVfs && 'vfs' !== $last) {
            $mess = 'Must use vfsStream as last wrapper';
            throw new \DomainException($mess);
        }
    }