protected function getWpFilesystemModule($throw = true)
    {
        try {
            /** @noinspection PhpIncompatibleReturnTypeInspection */
            return $this->getModule('WPFilesystem');
        } catch (ModuleException $e) {
            if (!$throw) {
                return null;
            }

            $message = 'This method requires the WPFilesystem module.';
            throw new ModuleException(__CLASS__, $message);
        }
    }