protected function isManifest($file)
    {
        if (is_file($file) && is_readable($file)) {
            if ($contents = file_get_contents($file)) {
                $this->manifest = @json_decode($contents);

                if ($this->manifest && isset($this->manifest->name) && is_string($this->manifest->name)) {
                    $this->manifest->name = basename($this->manifest->name);

                    if ($this->manifest->name === basename(dirname($file))) {
                        return (bool) preg_match($this->pluginNamePattern, $this->manifest->name);
                    }
                }
            }
        }

        return false;
    }