protected static function getRootPackage() {
    $file = new JsonFile('composer.json');

    // Split the current working directory into an array, accounting for leading
    // and trailing directory separators.
    $dir = explode(DIRECTORY_SEPARATOR, trim(getcwd(), DIRECTORY_SEPARATOR));

    do {
      if ($file->exists()) {
        $info = $file->read();

        if (isset($info['require']['goalgorilla/open_social'])) {
          return $file;
        }
      }
      chdir('..');
      array_pop($dir);
    }
    while ($dir);

    throw new \RuntimeException('Could not locate the root package.');
  }