original_string: private function packageExists($slug, $package)
      {
          $path = Grav::instance()['locator']->findResource($package->package_type . '://' . $slug);
          Installer::isValidDestination($path);
          return Installer::lastErrorCode();
      }
code: private function packageExists($slug, $package)
      {
          $path = Grav::instance()['locator']->findResource($package->package_type . '://' . $slug);
          Installer::isValidDestination($path);
          return Installer::lastErrorCode();
      }
code_tokens: private function packageExists ( $ slug , $ package ) { $ path = Grav :: instance ( ) [ 'locator' ] -> findResource ( $ package -> package_type . '://' . $ slug ) ; Installer :: isValidDestination ( $ path ) ; return Installer :: lastErrorCode ( ) ; }
docstring: Check if package exists
  
  @param string $slug
  @param Package $package
  @return int
docstring_tokens: Check if package exists