コード例 #1
0
ファイル: RevisionFile.php プロジェクト: kalyabin/comitka
 /**
  * @inheritdoc
  */
 public function init()
 {
     if (!$this->project instanceof Project) {
         throw new InvalidParamException('Project variable must be an instance of ' . Project::className());
     }
     if (!$this->repository instanceof BaseRepository) {
         throw new InvalidParamException('Repository variable must be an instance of ' . BaseRepository::className());
     }
     if (!$this->commit instanceof BaseCommit) {
         throw new InvalidParamException('Commit variable must be an instance of ' . BaseCommit::className());
     }
     if (!$this->file instanceof File) {
         throw new InvalidParamException('File variable must be an instance of ' . File::className());
     }
     $this->id = $this->commit->getId() . md5($this->file->getPathname());
 }