Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Gitlab/Model/Branch.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Branch extends AbstractModel

public static function fromArray(Client $client, Project $project, array $data)
{
$branch = new Branch($project, $data['name'], $client);
$branch = new static($project, $data['name'], $client);

if (isset($data['commit'])) {
$data['commit'] = Commit::fromArray($client, $project, $data['commit']);
Expand Down
2 changes: 1 addition & 1 deletion lib/Gitlab/Model/Commit.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Commit extends AbstractModel

public static function fromArray(Client $client, Project $project, array $data)
{
$commit = new Commit($project, $data['id'], $client);
$commit = new static($project, $data['id'], $client);

if (isset($data['parents'])) {
$parents = array();
Expand Down
2 changes: 1 addition & 1 deletion lib/Gitlab/Model/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Event extends AbstractModel

public static function fromArray(Client $client, Project $project, array $data)
{
$event = new Event($project, $client);
$event = new static($project, $client);

return $event->hydrate($data);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Gitlab/Model/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class File extends AbstractModel

public static function fromArray(Client $client, Project $project, array $data)
{
$file = new File($project, $data['file_path'], $client);
$file = new static($project, $data['file_path'], $client);

return $file->hydrate($data);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Gitlab/Model/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Group extends AbstractModel

public static function fromArray(Client $client, array $data)
{
$group = new Group($data['id'], $client);
$group = new static($data['id'], $client);

if (isset($data['projects'])) {
$projects = array();
Expand Down
2 changes: 1 addition & 1 deletion lib/Gitlab/Model/Hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Hook extends AbstractModel

public static function fromArray(Client $client, array $data)
{
$hook = new Hook($data['id'], $client);
$hook = new static($data['id'], $client);

return $hook->hydrate($data);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/Gitlab/Model/Issue.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Issue extends AbstractModel

public static function fromArray(Client $client, Project $project, array $data)
{
$issue = new Issue($project, $data['id'], $client);
$issue = new static($project, $data['id'], $client);

if (isset($data['author'])) {
$data['author'] = User::fromArray($client, $data['author']);
Expand All @@ -50,14 +50,14 @@ public function show()
{
$data = $this->api('issues')->show($this->project->id, $this->id);

return Issue::fromArray($this->getClient(), $this->project, $data);
return static::fromArray($this->getClient(), $this->project, $data);
}

public function update(array $params)
{
$data = $this->api('issues')->update($this->project->id, $this->id, $params);

return Issue::fromArray($this->getClient(), $this->project, $data);
return static::fromArray($this->getClient(), $this->project, $data);
}

public function close($comment = null)
Expand Down
2 changes: 1 addition & 1 deletion lib/Gitlab/Model/Key.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Key extends AbstractModel

public static function fromArray(Client $client, array $data)
{
$key = new Key($client);
$key = new static($client);

return $key->hydrate($data);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/Gitlab/Model/MergeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class MergeRequest extends AbstractModel

public static function fromArray(Client $client, Project $project, array $data)
{
$mr = new MergeRequest($project, $data['id'], $client);
$mr = new static($project, $data['id'], $client);

if (isset($data['author'])) {
$data['author'] = User::fromArray($client, $data['author']);
Expand All @@ -52,14 +52,14 @@ public function show()
{
$data = $this->api('mr')->show($this->project->id, $this->id);

return MergeRequest::fromArray($this->getClient(), $this->project, $data);
return static::fromArray($this->getClient(), $this->project, $data);
}

public function update(array $params)
{
$data = $this->api('mr')->update($this->project->id, $this->id, $params);

return MergeRequest::fromArray($this->getClient(), $this->project, $data);
return static::fromArray($this->getClient(), $this->project, $data);
}

public function close($comment = null)
Expand Down
6 changes: 3 additions & 3 deletions lib/Gitlab/Model/Milestone.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Milestone extends AbstractModel

public static function fromArray(Client $client, Project $project, array $data)
{
$milestone = new Milestone($project, $data['id'], $client);
$milestone = new static($project, $data['id'], $client);

return $milestone->hydrate($data);
}
Expand All @@ -39,14 +39,14 @@ public function show()
{
$data = $this->api('milestones')->show($this->project->id, $this->id);

return Milestone::fromArray($this->getClient(), $this->project, $data);
return static::fromArray($this->getClient(), $this->project, $data);
}

public function update(array $params)
{
$data = $this->api('milestones')->update($this->project->id, $this->id, $params);

return Milestone::fromArray($this->getClient(), $this->project, $data);
return static::fromArray($this->getClient(), $this->project, $data);
}

public function complete()
Expand Down
2 changes: 1 addition & 1 deletion lib/Gitlab/Model/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Node extends AbstractModel

public static function fromArray(Client $client, Project $project, array $data)
{
$node = new Node($project, $data['id'], $client);
$node = new static($project, $data['id'], $client);

return $node->hydrate($data);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Gitlab/Model/Note.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Note extends AbstractModel

public static function fromArray(Client $client, $type, array $data)
{
$comment = new Note($type, $data['id'], $client);
$comment = new static($type, $data['id'], $client);

if (isset($data['author'])) {
$data['author'] = User::fromArray($client, $data['author']);
Expand Down
6 changes: 3 additions & 3 deletions lib/Gitlab/Model/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Project extends AbstractModel

public static function fromArray(Client $client, array $data)
{
$project = new Project($data['id']);
$project = new static($data['id']);
$project->setClient($client);

if (isset($data['owner'])) {
Expand All @@ -53,7 +53,7 @@ public static function create(Client $client, $name, array $params = array())
{
$data = $client->api('projects')->create($name, $params);

return Project::fromArray($client, $data);
return static::fromArray($client, $data);
}

public function __construct($id = null, Client $client = null)
Expand All @@ -66,7 +66,7 @@ public function show()
{
$data = $this->api('projects')->show($this->id);

return Project::fromArray($this->getClient(), $data);
return static::fromArray($this->getClient(), $data);
}

public function remove()
Expand Down
2 changes: 1 addition & 1 deletion lib/Gitlab/Model/ProjectNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ProjectNamespace extends AbstractModel

public static function fromArray(Client $client, array $data)
{
$project = new ProjectNamespace($data['id']);
$project = new static($data['id']);
$project->setClient($client);

return $project->hydrate($data);
Expand Down
2 changes: 1 addition & 1 deletion lib/Gitlab/Model/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Session extends AbstractModel

public static function fromArray(Client $client, array $data)
{
$session = new Session($client);
$session = new static($client);

return $session->hydrate($data);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/Gitlab/Model/Snippet.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Snippet extends AbstractModel

public static function fromArray(Client $client, Project $project, array $data)
{
$snippet = new Snippet($project, $data['id'], $client);
$snippet = new static($project, $data['id'], $client);

if (isset($data['author'])) {
$data['author'] = User::fromArray($client, $data['author']);
Expand All @@ -40,14 +40,14 @@ public function show()
{
$data = $this->api('snippets')->show($this->project->id, $this->id);

return Snippet::fromArray($this->getClient(), $this, $data);
return static::fromArray($this->getClient(), $this, $data);
}

public function update(array $params)
{
$data = $this->api('snippets')->update($this->project->id, $this->id, $params);

return Snippet::fromArray($this->getClient(), $this, $data);
return static::fromArray($this->getClient(), $this, $data);
}

public function content()
Expand Down
2 changes: 1 addition & 1 deletion lib/Gitlab/Model/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Tag extends AbstractModel

public static function fromArray(Client $client, Project $project, array $data)
{
$branch = new Tag($project, $data['name'], $client);
$branch = new static($project, $data['name'], $client);

if (isset($data['commit'])) {
$data['commit'] = Commit::fromArray($client, $project, $data['commit']);
Expand Down
8 changes: 4 additions & 4 deletions lib/Gitlab/Model/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static function fromArray(Client $client, array $data)
{
$id = isset($data['id']) ? $data['id'] : 0;

$user = new User($id, $client);
$user = new static($id, $client);

return $user->hydrate($data);
}
Expand All @@ -44,7 +44,7 @@ public static function create(Client $client, $email, $password, array $params =
{
$data = $client->api('users')->create($email, $password, $params);

return User::fromArray($client, $data);
return static::fromArray($client, $data);
}

public function __construct($id = null, Client $client = null)
Expand All @@ -58,14 +58,14 @@ public function show()
{
$data = $this->api('users')->show($this->id);

return User::fromArray($this->getClient(), $data);
return static::fromArray($this->getClient(), $data);
}

public function update(array $params)
{
$data = $this->api('users')->update($this->id, $params);

return User::fromArray($this->getClient(), $data);
return static::fromArray($this->getClient(), $data);
}

public function remove()
Expand Down