protected static function getComposerContentOfFile($resource, VcsDriverInterface $driver, $method)
    {
        try {
            $ref = new \ReflectionClass($driver);
            $meth = $ref->getMethod($method);
            $meth->setAccessible(true);
            $composer = $meth->invoke($driver, $resource);

            if ('getContents' !== $method) {
                $file = (array) JsonFile::parseJson((string) $composer, $resource);
                $composer = empty($file) || !\array_key_exists('data', $file)
                    ? false : $file['data'];
            }
        } catch (\Exception $e) {
            $composer = false;
        }

        return $composer;
    }