|
@@ -93,7 +93,7 @@ class Package
|
|
|
$this->createdAt = new \DateTime;
|
|
|
}
|
|
|
|
|
|
- public function toJson()
|
|
|
+ public function toArray()
|
|
|
{
|
|
|
$versions = array();
|
|
|
foreach ($this->getVersions() as $version) {
|
|
@@ -104,14 +104,14 @@ class Package
|
|
|
$maintainers[] = $maintainer->toArray();
|
|
|
}
|
|
|
$data = array(
|
|
|
- 'name' => $this->name,
|
|
|
- 'description' => $this->description,
|
|
|
+ 'name' => $this->getName(),
|
|
|
+ 'description' => $this->getDescription(),
|
|
|
'dist-tags' => array(),
|
|
|
'maintainers' => $maintainers,
|
|
|
'versions' => $versions,
|
|
|
- 'type' => $this->type,
|
|
|
+ 'type' => $this->getType(),
|
|
|
);
|
|
|
- return json_encode($data);
|
|
|
+ return $data;
|
|
|
}
|
|
|
|
|
|
public function setRepositoryProvider(RepositoryProviderInterface $provider)
|