diff --git a/Utils/Git/Author.php b/Utils/Git/Author.php new file mode 100644 index 000000000..23234fd77 --- /dev/null +++ b/Utils/Git/Author.php @@ -0,0 +1,25 @@ +name = $name; + $this->email = $email; + } + + public function getName() : string + { + return $name; + } + + public function getEmail() : string + { + return $email; + } +} \ No newline at end of file diff --git a/Utils/Git/Branch b/Utils/Git/Branch new file mode 100644 index 000000000..c7a0af4fc --- /dev/null +++ b/Utils/Git/Branch @@ -0,0 +1,23 @@ +name = $name; + } + + public function setName(string $name) + { + $this->name = $name; + } + + public function getName() : string + { + return $this->name; + } +} \ No newline at end of file diff --git a/Utils/Git/Commit.php b/Utils/Git/Commit.php index e69de29bb..b7e101c27 100644 --- a/Utils/Git/Commit.php +++ b/Utils/Git/Commit.php @@ -0,0 +1,105 @@ +files[$path])) { + $this->files[$path] = []; + } + } + + public function addChange(string $path, int $line, string $old, string $new) + { + if(!isset($this->files[$path])) { + throw new \Exception(); + } + + if(!isset($this->files[$path][$line])) { + $this->files[$path][$line] => ['old' => $old, 'new' => $new]; + } else { + throw new \Exception(); + } + } + + public function setMessage(string $message) + { + $this->message = $message; + } + + public function getMessage() : string + { + return $this->message; + } + + public function getFiles() : array { + return $this->files; + } + + public function removeFile(string $path) { + + } + + public function setAuthor(Author $author) + { + $this->author = $author; + } + + public function getAuthor() : Author + { + return $this->author; + } + + public function setBranch(Branch $branch) { + $this->branch = $branch; + } + + public function getBranch() : Branch + { + return $this->branch; + } + + public function setTag(Tag $tag) { + $this->tag = $tag; + } + + public function getTag() : Tag + { + return $this->tag; + } + + public function getDate() : \DateTime + { + return $this->date; + } + + public function setRepository(Reporsitory $repository) + { + $this->repository = $repository; + } + + public function getRepository() : Reporsitory + { + retrun $this->repository; + } +} \ No newline at end of file diff --git a/Utils/Git/Repository.php b/Utils/Git/Repository.php index c8f0d6877..e5eb399b2 100644 --- a/Utils/Git/Repository.php +++ b/Utils/Git/Repository.php @@ -266,7 +266,14 @@ class Repository public function getCommitsCount() : string { - return $this->run('shortlog -s -n --all'); + $result = $this->normalizeResult($this->run('shortlog -s -n --all')); + + return ['']; + } + + private function normalizeResult(string $result) : string + { + str_replace('\t', '|', trim($result)); } public function getCommitsBy(string $author, \DateTime $start, \DateTime $end) : string diff --git a/Utils/Git/Tag.php b/Utils/Git/Tag.php new file mode 100644 index 000000000..e69de29bb