@@ -70,10 +70,16 @@ |
||
70 | 70 | return permission_db_authorized_ugroups(Git::PERM_ADMIN, $project->getID()); |
71 | 71 | } |
72 | 72 | |
73 | + /** |
|
74 | + * @return integer |
|
75 | + */ |
|
73 | 76 | private function getDefaultGitAdminPermissions() { |
74 | 77 | return permission_db_get_defaults(Git::PERM_ADMIN); |
75 | 78 | } |
76 | 79 | |
80 | + /** |
|
81 | + * @param integer $project_id |
|
82 | + */ |
|
77 | 83 | public function getCurrentGitAdminUgroups($project_id) { |
78 | 84 | return $this->permissions_manager->getAuthorizedUgroupIds($project_id, Git::PERM_ADMIN); |
79 | 85 | } |
@@ -46,6 +46,9 @@ discard block |
||
46 | 46 | */ |
47 | 47 | const SERVICE_SHORTNAME = 'plugin_git'; |
48 | 48 | |
49 | + /** |
|
50 | + * @param integer $id |
|
51 | + */ |
|
49 | 52 | public function __construct($id) { |
50 | 53 | parent::__construct($id); |
51 | 54 | $this->setScope(Plugin::SCOPE_PROJECT); |
@@ -593,7 +596,6 @@ discard block |
||
593 | 596 | |
594 | 597 | /** |
595 | 598 | * |
596 | - * @param PFUser $user |
|
597 | 599 | * @return Git_UserAccountManager |
598 | 600 | */ |
599 | 601 | private function getUserAccountManager() { |
@@ -689,6 +691,9 @@ discard block |
||
689 | 691 | $this->getLogger()->info('Successfully pushed ssh keys for user: '.$user->getUnixName()); |
690 | 692 | } |
691 | 693 | |
694 | + /** |
|
695 | + * @return PFUser |
|
696 | + */ |
|
692 | 697 | private function getUserFromParameters($params) { |
693 | 698 | if (! isset($params['user']) || ! $params['user'] instanceof PFUser) { |
694 | 699 | $this->getLogger()->error('Invalid user passed in params: ' . print_r($params, true)); |
@@ -1083,6 +1088,9 @@ discard block |
||
1083 | 1088 | } |
1084 | 1089 | |
1085 | 1090 | |
1091 | + /** |
|
1092 | + * @return ProjectUGroup |
|
1093 | + */ |
|
1086 | 1094 | private function getUGroupFromParams(array $params) { |
1087 | 1095 | if (isset($params['ugroup'])) { |
1088 | 1096 | return $params['ugroup']; |
@@ -26,6 +26,9 @@ |
||
26 | 26 | */ |
27 | 27 | class GitPluginInfo extends PluginFileInfo { |
28 | 28 | |
29 | + /** |
|
30 | + * @param GitPlugin $plugin |
|
31 | + */ |
|
29 | 32 | public function __construct( $plugin ) { |
30 | 33 | parent::__construct($plugin, 'config'); |
31 | 34 | $this->setPluginDescriptor( new GitPluginDescriptor() ); |
@@ -426,6 +426,9 @@ discard block |
||
426 | 426 | return $this->creationDate; |
427 | 427 | } |
428 | 428 | |
429 | + /** |
|
430 | + * @param PFUser $user |
|
431 | + */ |
|
429 | 432 | public function setCreator($user) { |
430 | 433 | $this->creator = $user; |
431 | 434 | } |
@@ -695,6 +698,7 @@ discard block |
||
695 | 698 | |
696 | 699 | /** |
697 | 700 | * Rename project |
701 | + * @param string $newName |
|
698 | 702 | */ |
699 | 703 | public function renameProject(Project $project, $newName) { |
700 | 704 | $newName = strtolower($newName); |
@@ -780,6 +784,9 @@ discard block |
||
780 | 784 | return $this->getBackend()->userCanRead($user, $this); |
781 | 785 | } |
782 | 786 | |
787 | + /** |
|
788 | + * @param PFUser $user |
|
789 | + */ |
|
783 | 790 | public function userCanEditOnline($user) { |
784 | 791 | return $user->hasPermission(Git::PERM_WRITE, $this->getId(), $this->getProjectId()) && $this->use_online_edit; |
785 | 792 | } |
@@ -839,7 +846,7 @@ discard block |
||
839 | 846 | * |
840 | 847 | * @param PFUser $user the user |
841 | 848 | * |
842 | - * @return true if the repo is a personnal rep and if it is created by $user |
|
849 | + * @return boolean if the repo is a personnal rep and if it is created by $user |
|
843 | 850 | */ |
844 | 851 | public function belongsTo(PFUser $user) { |
845 | 852 | return $this->getScope() == self::REPO_SCOPE_INDIVIDUAL && $this->getCreatorId() == $user->getId(); |
@@ -854,6 +861,9 @@ discard block |
||
854 | 861 | $this->remote_server_id = $id; |
855 | 862 | } |
856 | 863 | |
864 | + /** |
|
865 | + * @return integer |
|
866 | + */ |
|
857 | 867 | public function getRemoteServerId() { |
858 | 868 | return $this->remote_server_id; |
859 | 869 | } |
@@ -53,6 +53,7 @@ discard block |
||
53 | 53 | /** |
54 | 54 | * Get a project repository by its id |
55 | 55 | * |
56 | + * @param integer $id |
|
56 | 57 | * @return GitRepository the repository or null if not found |
57 | 58 | */ |
58 | 59 | public function getRepositoryByIdUserCanSee(PFUser $user, $id) { |
@@ -139,7 +140,6 @@ discard block |
||
139 | 140 | /** |
140 | 141 | * Get a project repository by its id |
141 | 142 | * |
142 | - * @param int $id The id of the repository to load |
|
143 | 143 | * |
144 | 144 | * @return GitRepository the repository or null if not found |
145 | 145 | */ |
@@ -234,8 +234,8 @@ discard block |
||
234 | 234 | /** |
235 | 235 | * Attempt to get repository if path match given base directory |
236 | 236 | * |
237 | - * @param type $base_dir A top level directory that can contains repo |
|
238 | - * @param type $path Full repository path |
|
237 | + * @param string $base_dir A top level directory that can contains repo |
|
238 | + * @param string $path Full repository path |
|
239 | 239 | * |
240 | 240 | * @return GitRepository |
241 | 241 | */ |
@@ -309,6 +309,7 @@ discard block |
||
309 | 309 | * Get the list of all repositories for a given project |
310 | 310 | * |
311 | 311 | * @param Int $project_id |
312 | + * @param integer $retention_period |
|
312 | 313 | * |
313 | 314 | * @return GitRepository[] |
314 | 315 | */ |
@@ -96,6 +96,9 @@ discard block |
||
96 | 96 | $this->git_system_event_manager->queueRepositoryUpdate($repository); |
97 | 97 | } |
98 | 98 | |
99 | + /** |
|
100 | + * @param string $bundle_path |
|
101 | + */ |
|
99 | 102 | public function createFromBundle(GitRepository $repository, GitRepositoryCreator $creator, $bundle_path) { |
100 | 103 | if (!$creator->isNameValid($repository->getName())) { |
101 | 104 | throw new Exception($GLOBALS['Language']->getText('plugin_git', 'actions_input_format_error', array($creator->getAllowedCharsInNamePattern(), GitDao::REPO_NAME_MAX_LENGTH))); |
@@ -173,6 +176,9 @@ discard block |
||
173 | 176 | throw new Exception($GLOBALS['Language']->getText('plugin_git', 'actions_no_repository_forked')); |
174 | 177 | } |
175 | 178 | |
179 | + /** |
|
180 | + * @param string $namespace |
|
181 | + */ |
|
176 | 182 | private function isNamespaceValid(GitRepository $repository, $namespace) { |
177 | 183 | if ($namespace) { |
178 | 184 | $ns_chunk = explode('/', $namespace); |
@@ -186,6 +192,10 @@ discard block |
||
186 | 192 | return true; |
187 | 193 | } |
188 | 194 | |
195 | + /** |
|
196 | + * @param string $namespace |
|
197 | + * @param string $scope |
|
198 | + */ |
|
189 | 199 | private function forkAllRepositories(array $repos, PFUser $user, $namespace, $scope, Project $project, array $forkPermissions) { |
190 | 200 | $forked = false; |
191 | 201 | foreach ($repos as $repo) { |
@@ -206,10 +216,8 @@ discard block |
||
206 | 216 | /** |
207 | 217 | * Return true if proposed name already exists as a repository path |
208 | 218 | * |
209 | - * @param Project $project |
|
210 | - * @param String $name |
|
211 | 219 | * |
212 | - * @return Boolean |
|
220 | + * @return boolean|null |
|
213 | 221 | */ |
214 | 222 | public function isRepositoryNameAlreadyUsed(GitRepository $new_repository) { |
215 | 223 | $repositories = $this->repository_factory->getAllRepositories($new_repository->getProject()); |
@@ -228,6 +236,9 @@ discard block |
||
228 | 236 | } |
229 | 237 | } |
230 | 238 | |
239 | + /** |
|
240 | + * @param string $new_path |
|
241 | + */ |
|
231 | 242 | private function nameIsSubPathOfExistingRepository($repository_path, $new_path) { |
232 | 243 | $repo_path_without_dot_git = $this->stripFinalDotGit($repository_path); |
233 | 244 | if (strpos($new_path, "$repo_path_without_dot_git/") === 0) { |
@@ -236,6 +247,9 @@ discard block |
||
236 | 247 | return false; |
237 | 248 | } |
238 | 249 | |
250 | + /** |
|
251 | + * @param string $new_path |
|
252 | + */ |
|
239 | 253 | private function nameAlreadyExistsAsPath($repository_path, $new_path) { |
240 | 254 | $new_path = $this->stripFinalDotGit($new_path); |
241 | 255 | if (strpos($repository_path, "$new_path/") === 0) { |
@@ -43,6 +43,9 @@ discard block |
||
43 | 43 | /** @var Git_Mirror_MirrorDataMapper */ |
44 | 44 | private $mirror_data_mapper; |
45 | 45 | |
46 | + /** |
|
47 | + * @param Git $controller |
|
48 | + */ |
|
46 | 49 | public function __construct( |
47 | 50 | $controller, |
48 | 51 | Git_GitRepositoryUrlManager $url_manager, |
@@ -72,6 +75,9 @@ discard block |
||
72 | 75 | $GLOBALS['HTML']->footer(array()); |
73 | 76 | } |
74 | 77 | |
78 | + /** |
|
79 | + * @param string $key |
|
80 | + */ |
|
75 | 81 | public function getText($key, $params=array() ) { |
76 | 82 | return $GLOBALS['Language']->getText('plugin_git', $key, $params); |
77 | 83 | } |
@@ -88,6 +94,7 @@ discard block |
||
88 | 94 | |
89 | 95 | /** |
90 | 96 | * HELP VIEW |
97 | + * @param string $topic |
|
91 | 98 | */ |
92 | 99 | public function help($topic, $params=array()) { |
93 | 100 | if ( empty($topic) ) { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | /** |
59 | 59 | * Display access control management for gitshell backend |
60 | 60 | * |
61 | - * @return void |
|
61 | + * @return string |
|
62 | 62 | */ |
63 | 63 | private function accessControl() { |
64 | 64 | $html = ''; |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | /** |
86 | 86 | * Display access control management for gitolite backend |
87 | 87 | * |
88 | - * @return void |
|
88 | + * @return string |
|
89 | 89 | */ |
90 | 90 | private function accessControlGitolite() { |
91 | 91 | $forkPermissionsManager = new GitForkPermissionsManager($this->repository); |
@@ -199,8 +199,9 @@ |
||
199 | 199 | /** |
200 | 200 | * Fetch the html code to display the icon of a repository (depends on type of project) |
201 | 201 | * |
202 | - * @param $access |
|
202 | + * @param string $access |
|
203 | 203 | * @param $backend_type |
204 | + * @param boolean $backendIsGitolite |
|
204 | 205 | */ |
205 | 206 | private function getAccessType($access, $backendIsGitolite) { |
206 | 207 | if ($backendIsGitolite) { |