From cb3bfc6f1e487e572870afae5d52ef3c7d250d8a Mon Sep 17 00:00:00 2001 From: Johan Fredrik Varen Date: Mon, 15 Feb 2021 12:41:33 +0100 Subject: [PATCH] Fixed issue #61: Replacing all occurrences of 'self' return type annotations in GitRepository with 'static' for static methods and IGit for non-static methods. --- src/GitRepository.php | 48 +++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/GitRepository.php b/src/GitRepository.php index 66d67b2..59089ef 100644 --- a/src/GitRepository.php +++ b/src/GitRepository.php @@ -52,7 +52,7 @@ public function getRepositoryPath() * @param string * @param array|NULL * @throws GitException - * @return self + * @return IGit */ public function createTag($name, $options = NULL) { @@ -67,7 +67,7 @@ public function createTag($name, $options = NULL) * `git tag -d ` * @param string * @throws GitException - * @return self + * @return IGit */ public function removeTag($name) { @@ -86,7 +86,7 @@ public function removeTag($name) * @param string * @param string * @throws GitException - * @return self + * @return IGit */ public function renameTag($oldName, $newName) { @@ -117,7 +117,7 @@ public function getTags() * @param string * @param array|NULL * @throws GitException - * @return self + * @return IGit */ public function merge($branch, $options = NULL) { @@ -134,7 +134,7 @@ public function merge($branch, $options = NULL) * @param string * @param bool * @throws GitException - * @return self + * @return IGit */ public function createBranch($name, $checkout = FALSE) { @@ -157,7 +157,7 @@ public function createBranch($name, $checkout = FALSE) * `git branch -d ` * @param string * @throws GitException - * @return self + * @return IGit */ public function removeBranch($name) { @@ -242,7 +242,7 @@ public function getLocalBranches() * `git checkout ` * @param string * @throws GitException - * @return self + * @return IGit */ public function checkout($name) { @@ -257,7 +257,7 @@ public function checkout($name) * `git rm ` * @param string|string[] * @throws GitException - * @return self + * @return IGit */ public function removeFile($file) { @@ -282,7 +282,7 @@ public function removeFile($file) * `git add ` * @param string|string[] * @throws GitException - * @return self + * @return IGit */ public function addFile($file) { @@ -314,7 +314,7 @@ public function addFile($file) * Adds all created, modified & removed files. * `git add --all` * @throws GitException - * @return self + * @return IGit */ public function addAllChanges() { @@ -330,7 +330,7 @@ public function addAllChanges() * @param string|string[] from: array('from' => 'to', ...) || (from, to) * @param string|NULL * @throws GitException - * @return self + * @return IGit */ public function renameFile($file, $to = NULL) { @@ -358,7 +358,7 @@ public function renameFile($file, $to = NULL) * @param string * @param string[] param => value * @throws GitException - * @return self + * @return IGit */ public function commit($message, $params = NULL) { @@ -425,7 +425,7 @@ public function isChanges() * Pull changes from a remote * @param string|NULL * @param array|NULL - * @return self + * @return IGit * @throws GitException */ public function pull($remote = NULL, array $params = NULL) @@ -445,7 +445,7 @@ public function pull($remote = NULL, array $params = NULL) * Push changes to a remote * @param string|NULL * @param array|NULL - * @return self + * @return IGit * @throws GitException */ public function push($remote = NULL, array $params = NULL) @@ -465,7 +465,7 @@ public function push($remote = NULL, array $params = NULL) * Run fetch command to get latest branches * @param string|NULL * @param array|NULL - * @return self + * @return IGit * @throws GitException */ public function fetch($remote = NULL, array $params = NULL) @@ -486,7 +486,7 @@ public function fetch($remote = NULL, array $params = NULL) * @param string * @param string * @param array|NULL - * @return self + * @return IGit * @throws GitException */ public function addRemote($name, $url, array $params = NULL) @@ -501,7 +501,7 @@ public function addRemote($name, $url, array $params = NULL) * Renames remote repository * @param string * @param string - * @return self + * @return IGit * @throws GitException */ public function renameRemote($oldName, $newName) @@ -515,7 +515,7 @@ public function renameRemote($oldName, $newName) /** * Removes remote repository * @param string - * @return self + * @return IGit * @throws GitException */ public function removeRemote($name) @@ -531,7 +531,7 @@ public function removeRemote($name) * @param string * @param string * @param array|NULL - * @return self + * @return IGit * @throws GitException */ public function setRemoteUrl($name, $url, array $params = NULL) @@ -570,7 +570,7 @@ public function execute($cmd) /** - * @return self + * @return IGit */ protected function begin() { @@ -585,7 +585,7 @@ protected function begin() /** - * @return self + * @return IGit */ protected function end() { @@ -650,7 +650,7 @@ protected function extractFromCommand($cmd, $filter = NULL) /** * Runs command. * @param string|array - * @return self + * @return IGit * @throws GitException */ protected function run($cmd/*, $options = NULL*/) @@ -704,7 +704,7 @@ protected static function processCommand(array $args) * Init repo in directory * @param string * @param array|NULL - * @return self + * @return static * @throws GitException */ public static function init($directory, array $params = NULL) @@ -744,7 +744,7 @@ public static function init($directory, array $params = NULL) * @param string * @param string|NULL * @param array|NULL - * @return self + * @return static * @throws GitException */ public static function cloneRepository($url, $directory = NULL, array $params = NULL)