Skip to content

Commit

Permalink
Solidify type names
Browse files Browse the repository at this point in the history
  • Loading branch information
aredridel committed Mar 18, 2012
1 parent 2de1dd7 commit a2ba703
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
6 changes: 5 additions & 1 deletion lib/Glip/GitBlob.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,8 @@ protected function _serialize()
{
return $this->data['data'];
}
}

public function getTypeName() {
return 'blob';
}
}
6 changes: 5 additions & 1 deletion lib/Glip/GitCommit.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,4 +294,8 @@ public function count()
{
return $this->tree->count();
}
}

public function getTypeName() {
return 'commit';
}
}
5 changes: 1 addition & 4 deletions lib/Glip/GitObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,7 @@ public function __get($name)
* @return (string) the type name
* @author Sjoerd de Jong
**/
public function getTypeName()
{
return strtolower(substr(get_class($this),3));
}
abstract public function getTypeName();

/**
* Get the object's type number
Expand Down
6 changes: 5 additions & 1 deletion lib/Glip/GitTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,4 +384,8 @@ public function count()
{
return count($this->nodes);
}
}

public function getTypeName() {
return 'tree';
}
}

0 comments on commit a2ba703

Please sign in to comment.