diff --git a/lib/models/Repository.php b/lib/models/Repository.php index 9210f2f..ef64f79 100644 --- a/lib/models/Repository.php +++ b/lib/models/Repository.php @@ -367,26 +367,26 @@ class Repository implements \JsonSerializable { return (object) [ 'clone_url' => ($url = $this->getCloneUrl()) ? (string) $url : null, 'created_at' => ($date = $this->getCreatedAt()) ? $date->format('c') : null, - 'default_branch' => 'defaultBranch', - 'description', - 'empty' => 'isEmpty', - 'fork' => 'isFork', - 'forks_count' => 'forksCount', - 'full_name' => 'fullName', + 'default_branch' => $this->getDefaultBranch(), + 'description' => $this->getDescription(), + 'empty' => $this->isEmpty(), + 'fork' => $this->isFork(), + 'forks_count' => $this->getForksCount(), + 'full_name' => $this->getFullName(), 'html_url' => ($url = $this->getHtmlUrl()) ? (string) $url : null, - 'id', - 'mirror' => 'isMirror', - 'name', - 'open_issues_count' => 'openIssuesCount', - 'owner', - 'parent', - 'permissions', - 'private' => 'isPrivate', - 'size', + 'id' => $this->getId(), + 'mirror' => $this->isMirror(), + 'name' => $this->getName(), + 'open_issues_count' => $this->getOpenIssuesCount(), + 'owner' => ($user = $this->getOwner()) ? $user->jsonSerialize() : null, + 'parent' => ($repository = $this->getParent()) ? $repository->jsonSerialize() : null, + 'permissions' => ($perms = $this->getPermissions()) ? $perms->jsonSerialize() : null, + 'private' => $this->isPrivate(), + 'size' => $this->getSize(), 'ssh_url' => ($url = $this->getSshUrl()) ? (string) $url : null, - 'stars_count' => 'starsCount', + 'stars_count' => $this->getStarsCount(), 'updated_at' => ($date = $this->getUpdatedAt()) ? $date->format('c') : null, - 'watchers_count' => 'watchersCount', + 'watchers_count' => $this->getWatchersCount(), 'website' => ($url = $this->getWebsite()) ? (string) $url : null, ]; }