Exemple #1
0
 /**
  * @param string $owner
  * @param string $repository
  */
 function __construct($owner, $repository)
 {
     $this->repo = new Url('https://github.com');
     $this->repo->appendPath($owner . '/' . $repository);
     $this->owner = new Url('https://github.com');
     $this->owner->appendPath($owner);
 }
 /**
  * @param string|NULL $package
  * @return string
  */
 public function getPackageUrl($package = NULL)
 {
     $url = new Url('https://packagist.org/packages');
     $url->appendPath('/');
     if ($package) {
         $url->appendPath($package);
     } else {
         $url->appendPath(isset($this->data['name']) ? $this->data['name'] : '#');
     }
     return $url;
 }