@@ -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(); |
@@ -64,6 +64,9 @@ discard block |
||
64 | 64 | $this->request = $request; |
65 | 65 | } |
66 | 66 | |
67 | + /** |
|
68 | + * @return Codendi_Request |
|
69 | + */ |
|
67 | 70 | public function getRequest() { |
68 | 71 | return $this->request; |
69 | 72 | } |
@@ -80,6 +83,7 @@ discard block |
||
80 | 83 | /** |
81 | 84 | * Wrapper of global redirect method |
82 | 85 | * @param String url |
86 | + * @param string $url |
|
83 | 87 | */ |
84 | 88 | public function redirect($url) { |
85 | 89 | $GLOBALS['HTML']->redirect($url); |
@@ -127,7 +131,7 @@ discard block |
||
127 | 131 | } |
128 | 132 | /** |
129 | 133 | * |
130 | - * @param <type> $action |
|
134 | + * @param string $action |
|
131 | 135 | */ |
132 | 136 | public function addPermittedAction($action) { |
133 | 137 | $this->permittedActions[] = $action; |
@@ -161,10 +165,16 @@ discard block |
||
161 | 165 | return $this->actionResultData; |
162 | 166 | } |
163 | 167 | |
168 | + /** |
|
169 | + * @param string $viewName |
|
170 | + */ |
|
164 | 171 | public function addView($viewName, $params=array()) { |
165 | 172 | $this->views[$viewName] = $params; |
166 | 173 | } |
167 | 174 | |
175 | + /** |
|
176 | + * @param string $actionName |
|
177 | + */ |
|
168 | 178 | public function addAction($actionName, $params=array()) { |
169 | 179 | $this->actions[$actionName] = $params; |
170 | 180 | } |
@@ -201,7 +211,7 @@ discard block |
||
201 | 211 | * This functions execute all methods added to the actions class array ($this->actions) |
202 | 212 | * An action is a method of PluginAction class child, several can be added for one request |
203 | 213 | * @TODO associate an action and a view in order to skip action call to provide data to a given view.(like Symfony framework component) |
204 | - * @return null |
|
214 | + * @return false|null |
|
205 | 215 | */ |
206 | 216 | function executeActions() { |
207 | 217 | if ( empty($this->actions) ) { |
@@ -60,6 +60,9 @@ |
||
60 | 60 | call_user_func_array(array($this,$name), $params); |
61 | 61 | } |
62 | 62 | |
63 | + /** |
|
64 | + * @param string $href |
|
65 | + */ |
|
63 | 66 | public static function linkTo($link, $href, $options='' ) { |
64 | 67 | $linkTo = '<a href="'.$href.'" '.$options.' >'.$link.'</a>'; |
65 | 68 | return $linkTo; |
@@ -30,6 +30,9 @@ |
||
30 | 30 | return preg_replace('%/{1,}%',"/", $path); |
31 | 31 | } |
32 | 32 | |
33 | +/** |
|
34 | + * @param string $namespace |
|
35 | + */ |
|
33 | 36 | function userRepoPath($username, $namespace) { |
34 | 37 | $path = unixPathJoin(array('u', $username, $namespace)); |
35 | 38 | if (strpos($path, '..') !== false) { |
@@ -65,6 +65,9 @@ |
||
65 | 65 | return $this->buildUGroupRepresentations($repository, $rewind_ugroups_rows); |
66 | 66 | } |
67 | 67 | |
68 | + /** |
|
69 | + * @param \DataAccessResult $ugroup_rows |
|
70 | + */ |
|
68 | 71 | private function buildUGroupRepresentations(GitRepository $repository, $ugroup_rows) { |
69 | 72 | $ugroup_representations = array(); |
70 | 73 | foreach ($ugroup_rows as $row) { |
@@ -29,21 +29,33 @@ discard block |
||
29 | 29 | $this->repository = new GitRepository(); |
30 | 30 | } |
31 | 31 | |
32 | + /** |
|
33 | + * @param string $path |
|
34 | + */ |
|
32 | 35 | public function withPath($path) { |
33 | 36 | $this->repository->setPath($path); |
34 | 37 | return $this; |
35 | 38 | } |
36 | 39 | |
40 | + /** |
|
41 | + * @param string $namespace |
|
42 | + */ |
|
37 | 43 | public function withNamespace($namespace) { |
38 | 44 | $this->repository->setNamespace($namespace); |
39 | 45 | return $this; |
40 | 46 | } |
41 | 47 | |
48 | + /** |
|
49 | + * @param integer $id |
|
50 | + */ |
|
42 | 51 | public function withId($id) { |
43 | 52 | $this->repository->setId($id); |
44 | 53 | return $this; |
45 | 54 | } |
46 | 55 | |
56 | + /** |
|
57 | + * @param string $name |
|
58 | + */ |
|
47 | 59 | public function withName($name) { |
48 | 60 | $this->repository->setName($name); |
49 | 61 | return $this; |
@@ -59,21 +71,33 @@ discard block |
||
59 | 71 | return $this; |
60 | 72 | } |
61 | 73 | |
74 | + /** |
|
75 | + * @param integer $id |
|
76 | + */ |
|
62 | 77 | public function withRemoteServerId($id) { |
63 | 78 | $this->repository->setRemoteServerId($id); |
64 | 79 | return $this; |
65 | 80 | } |
66 | 81 | |
82 | + /** |
|
83 | + * @param string $description |
|
84 | + */ |
|
67 | 85 | public function withDescription($description) { |
68 | 86 | $this->repository->setDescription($description); |
69 | 87 | return $this; |
70 | 88 | } |
71 | 89 | |
90 | + /** |
|
91 | + * @param string $prefix |
|
92 | + */ |
|
72 | 93 | public function withMailPrefix($prefix) { |
73 | 94 | $this->repository->setMailPrefix($prefix); |
74 | 95 | return $this; |
75 | 96 | } |
76 | 97 | |
98 | + /** |
|
99 | + * @param string[] $emails |
|
100 | + */ |
|
77 | 101 | public function withNotifiedEmails($emails) { |
78 | 102 | $this->repository->setNotifiedMails($emails); |
79 | 103 | return $this; |
@@ -79,6 +79,9 @@ |
||
79 | 79 | $this->driver = new Git_Driver_GerritREST($this->guzzle_client, $this->logger); |
80 | 80 | } |
81 | 81 | |
82 | + /** |
|
83 | + * @param string $text |
|
84 | + */ |
|
82 | 85 | protected function getGuzzleRequestWithTextResponse($text) { |
83 | 86 | $response = stub('Guzzle\Http\Message\Response')->getBody(true)->returns($text); |
84 | 87 | return stub('Guzzle\Http\Message\EntityEnclosingRequest')->send()->returns($response); |
@@ -277,6 +277,10 @@ |
||
277 | 277 | $this->assertEqual('project1/repo', $this->project_serializer->repoFullName($repo, $unix_name)); |
278 | 278 | } |
279 | 279 | |
280 | + /** |
|
281 | + * @param string $name |
|
282 | + * @param string $namespace |
|
283 | + */ |
|
280 | 284 | private function _GivenARepositoryWithNameAndNamespace($name, $namespace) { |
281 | 285 | $repo = new GitRepository(); |
282 | 286 | $repo->setName($name); |