@@ -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) { |
@@ -34,7 +34,6 @@ discard block |
||
34 | 34 | /** |
35 | 35 | * Constructor |
36 | 36 | * |
37 | - * @param GitViews $view The GitViews |
|
38 | 37 | */ |
39 | 38 | public function __construct($lastPushes, Git_GitRepositoryUrlManager $url_manager) { |
40 | 39 | parent::__construct(); |
@@ -133,6 +132,9 @@ discard block |
||
133 | 132 | return $html; |
134 | 133 | } |
135 | 134 | |
135 | + /** |
|
136 | + * @param integer $depth |
|
137 | + */ |
|
136 | 138 | protected function fetchRows($repositories, $depth) { |
137 | 139 | $nodeHtml = ''; |
138 | 140 | $leavesHtml = ''; |
@@ -175,6 +177,10 @@ discard block |
||
175 | 177 | return $html; |
176 | 178 | } |
177 | 179 | |
180 | + /** |
|
181 | + * @param string $class |
|
182 | + * @param string $description |
|
183 | + */ |
|
178 | 184 | protected function fetchHTMLRow($class, $depth, $label, $description, $lastPush) { |
179 | 185 | $HTMLPurifier = Codendi_HTMLPurifier::instance(); |
180 | 186 | $description = $HTMLPurifier->purify($description, CODENDI_PURIFIER_CONVERT_HTML); |
@@ -44,6 +44,10 @@ discard block |
||
44 | 44 | return false; |
45 | 45 | } |
46 | 46 | |
47 | + /** |
|
48 | + * @param string $file_name |
|
49 | + * @param string $commit_sha1 |
|
50 | + */ |
|
47 | 51 | private function getFormatedMarkdown($file_name, $commit_sha1) { |
48 | 52 | $content = $this->git_exec->getFileContent($commit_sha1, $file_name); |
49 | 53 | $content_in_form = GitMarkdownFileContentInForm::getMarkdownContentInForm($content); |
@@ -54,6 +58,10 @@ discard block |
||
54 | 58 | ); |
55 | 59 | } |
56 | 60 | |
61 | + /** |
|
62 | + * @param string $node |
|
63 | + * @param string $commit_sha1 |
|
64 | + */ |
|
57 | 65 | private function getReadmeFile($node, $commit_sha1) { |
58 | 66 | $files_list = $this->git_exec->lsTree($commit_sha1, $node); |
59 | 67 | $path = preg_quote($node, DIRECTORY_SEPARATOR); |
@@ -29,6 +29,9 @@ |
||
29 | 29 | /** @var Codendi_Request*/ |
30 | 30 | protected $request; |
31 | 31 | |
32 | + /** |
|
33 | + * @param Git $controller |
|
34 | + */ |
|
32 | 35 | public function __construct( $controller ) { |
33 | 36 | $this->controller = $controller; |
34 | 37 | $this->user = $controller->getUser(); |