@@ -18,6 +18,9 @@ |
||
18 | 18 | return $this->assertEquals($count, $length, "Failed XPath. Expected '$path' to be found $count times instead of $length."); |
19 | 19 | } |
20 | 20 | |
21 | + /** |
|
22 | + * @param string $path |
|
23 | + */ |
|
21 | 24 | public function assertNotXPath($html, $path) { |
22 | 25 | return !$this->assertXPath($html, $path, 0); |
23 | 26 | } |
@@ -48,6 +48,9 @@ discard block |
||
48 | 48 | unset($_ENV['HTTP_X_REQUESTED_WITH']); |
49 | 49 | } |
50 | 50 | |
51 | + /** |
|
52 | + * @param string $agent |
|
53 | + */ |
|
51 | 54 | protected function _setUserAgent($agent) { |
52 | 55 | if (isset($this->_env['HTTP_USER_AGENT'])) { |
53 | 56 | $this->_env['HTTP_USER_AGENT'] = $_ENV['HTTP_USER_AGENT']; |
@@ -63,6 +66,9 @@ discard block |
||
63 | 66 | } |
64 | 67 | } |
65 | 68 | |
69 | + /** |
|
70 | + * @param integer $id |
|
71 | + */ |
|
66 | 72 | protected function _loginUser($id) { |
67 | 73 | // see: http://stackoverflow.com/a/10411128/1372085 |
68 | 74 | $this->_logoutUser(); |
@@ -100,6 +106,9 @@ discard block |
||
100 | 106 | endif; |
101 | 107 | } |
102 | 108 | |
109 | + /** |
|
110 | + * @param string $name |
|
111 | + */ |
|
103 | 112 | protected function _notImplementedOnDatasource($name) { |
104 | 113 | $mc = $this->controller->modelClass; |
105 | 114 | $Ds = $this->controller->{$mc}->getDataSource(); |
@@ -4,6 +4,9 @@ |
||
4 | 4 | |
5 | 5 | trait SecurityMockTrait { |
6 | 6 | |
7 | + /** |
|
8 | + * @param string $controller |
|
9 | + */ |
|
7 | 10 | public function generate($controller, $mocks = []) { |
8 | 11 | $byPassSecurity = false; |
9 | 12 | if (!isset($mocks['components']['Security'])) { |
@@ -29,6 +29,10 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public $duration = 8035200; |
31 | 31 | |
32 | + /** |
|
33 | + * @param integer $userId |
|
34 | + * @param integer $blockedUserId |
|
35 | + */ |
|
32 | 36 | public function ignore($userId, $blockedUserId) { |
33 | 37 | $exists = $this->_get($userId, $blockedUserId); |
34 | 38 | if ($exists) { |
@@ -62,6 +66,9 @@ discard block |
||
62 | 66 | ]); |
63 | 67 | } |
64 | 68 | |
69 | + /** |
|
70 | + * @param integer $id |
|
71 | + */ |
|
65 | 72 | public function ignoredBy($id) { |
66 | 73 | return $this->find( |
67 | 74 | 'all', |
@@ -72,6 +79,9 @@ discard block |
||
72 | 79 | ); |
73 | 80 | } |
74 | 81 | |
82 | + /** |
|
83 | + * @param integer $userId |
|
84 | + */ |
|
75 | 85 | public function deleteUser($userId) { |
76 | 86 | $success = $this->deleteAll(['user_id' => $userId], false); |
77 | 87 | $success = $success && $this->deleteAll(['blocked_user_id' => $userId], false); |
@@ -81,8 +91,8 @@ discard block |
||
81 | 91 | /** |
82 | 92 | * counts how many users ignore the user with ID $id |
83 | 93 | * |
84 | - * @param $id |
|
85 | - * @return array |
|
94 | + * @param integer $id |
|
95 | + * @return integer |
|
86 | 96 | */ |
87 | 97 | public function countIgnored($id) { |
88 | 98 | return count($this->getIgnored($id)); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | /** |
170 | 170 | * |
171 | 171 | * @param string $version |
172 | - * @param array $action |
|
172 | + * @param string $action |
|
173 | 173 | * @param array $params |
174 | 174 | * @return object |
175 | 175 | */ |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | /** |
292 | 292 | * |
293 | 293 | * @param resource $ch |
294 | - * @param array $headers |
|
294 | + * @param string[] $headers |
|
295 | 295 | * @return void |
296 | 296 | */ |
297 | 297 | protected function setCurlOptions(&$ch, $headers = array()) |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | |
334 | 334 | /** |
335 | 335 | * |
336 | - * @param stdClass $o |
|
336 | + * @param \stdClass $o |
|
337 | 337 | * @return string |
338 | 338 | */ |
339 | 339 | public static function reg_imploder(\stdClass $o) |
@@ -94,6 +94,7 @@ discard block |
||
94 | 94 | * Preform requested target patch checks depending on the unique setting |
95 | 95 | * |
96 | 96 | * @var string chosen filename target_path |
97 | + * @param string $target_path |
|
97 | 98 | * @return string of resulting target_path |
98 | 99 | * @access private |
99 | 100 | */ |
@@ -217,7 +218,7 @@ discard block |
||
217 | 218 | /** |
218 | 219 | * Checks if there is a file uploaded |
219 | 220 | * |
220 | - * @return void |
|
221 | + * @return boolean |
|
221 | 222 | * @access public |
222 | 223 | * @param file array of uploaded file (optional) |
223 | 224 | */ |
@@ -293,7 +294,7 @@ discard block |
||
293 | 294 | } |
294 | 295 | |
295 | 296 | /** |
296 | - * @return boolean true if errors were detected. |
|
297 | + * @return integer true if errors were detected. |
|
297 | 298 | */ |
298 | 299 | function hasErrors(){ |
299 | 300 | return count($this->errors); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @param Array|Int $options takes an array of options passed to the image helper, or an integer representing the width of the image to display |
100 | 100 | * options: width = 100 (default), if width is set along with autoResize the uploaded image will be resized. |
101 | 101 | * @access public |
102 | - * @return mixed html tag, url string, or false if unable to find image. |
|
102 | + * @return string|false html tag, url string, or false if unable to find image. |
|
103 | 103 | */ |
104 | 104 | function image($name, $options = array()){ |
105 | 105 | $this->fileName = $name; |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | * Constructor |
330 | 330 | * |
331 | 331 | * @param [String $imgFile] Image File Name |
332 | - * @return RESIZEIMAGE (Class Object) |
|
332 | + * @return false|null (Class Object) |
|
333 | 333 | */ |
334 | 334 | function __construct($imgFile=""){ |
335 | 335 | if (!function_exists("imagecreate")){ |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | * Set image file name |
357 | 357 | * |
358 | 358 | * @param String $imgFile |
359 | - * @return void |
|
359 | + * @return boolean |
|
360 | 360 | */ |
361 | 361 | function setImage($imgFile){ |
362 | 362 | $this->imgFile=$imgFile; |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | * Resize a image to given width and height and keep it's current width and height ratio |
375 | 375 | * |
376 | 376 | * @param Number $imgwidth |
377 | - * @param Numnber $imgheight |
|
377 | + * @param integer $imgheight |
|
378 | 378 | * @param String $newfile |
379 | 379 | */ |
380 | 380 | function resize_limitwh($imgwidth,$imgheight,$newfile=NULL){ |
@@ -394,9 +394,9 @@ discard block |
||
394 | 394 | /** |
395 | 395 | * Resize an image to given percentage. |
396 | 396 | * |
397 | - * @param Number $percent |
|
397 | + * @param integer $percent |
|
398 | 398 | * @param String $newfile |
399 | - * @return Boolean |
|
399 | + * @return false|null |
|
400 | 400 | */ |
401 | 401 | function resize_percentage($percent=100,$newfile=NULL) { |
402 | 402 | $newWidth=($this->imgWidth*$percent)/100; |
@@ -407,10 +407,10 @@ discard block |
||
407 | 407 | /** |
408 | 408 | * Resize an image to given X and Y percentage. |
409 | 409 | * |
410 | - * @param Number $xpercent |
|
411 | - * @param Number $ypercent |
|
410 | + * @param integer $xpercent |
|
411 | + * @param integer $ypercent |
|
412 | 412 | * @param String $newfile |
413 | - * @return Boolean |
|
413 | + * @return false|null |
|
414 | 414 | */ |
415 | 415 | function resize_xypercentage($xpercent=100,$ypercent=100,$newfile=NULL) { |
416 | 416 | $newWidth=($this->imgWidth*$xpercent)/100; |
@@ -421,10 +421,10 @@ discard block |
||
421 | 421 | /** |
422 | 422 | * Resize an image to given width and height |
423 | 423 | * |
424 | - * @param Number $width |
|
425 | - * @param Number $height |
|
424 | + * @param integer $width |
|
425 | + * @param integer $height |
|
426 | 426 | * @param String $newfile |
427 | - * @return Boolean |
|
427 | + * @return false|null |
|
428 | 428 | */ |
429 | 429 | function resize($width,$height,$newfile=NULL){ |
430 | 430 | if(empty($this->imgFile)){ |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | * @param Number $width |
484 | 484 | * @param Number $height |
485 | 485 | * @param String $newfile |
486 | - * @return Boolean |
|
486 | + * @return false|null |
|
487 | 487 | */ |
488 | 488 | function _resize($width,$height,$newfile=NULL){ |
489 | 489 | if (!function_exists("imagecreate")){ |
@@ -110,7 +110,7 @@ |
||
110 | 110 | * credentials or create the missing database |
111 | 111 | * Create the database file and insert the submitted details |
112 | 112 | * |
113 | - * @return void |
|
113 | + * @return null|CakeResponse |
|
114 | 114 | * @access public |
115 | 115 | */ |
116 | 116 | public function database() { |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * Finalize installation |
16 | 16 | * |
17 | 17 | * @param $user |
18 | - * @return mixed if false, indicates processing failure |
|
18 | + * @return boolean if false, indicates processing failure |
|
19 | 19 | */ |
20 | 20 | public function finalize($user) { |
21 | 21 | if (Configure::read('Install.installed') && Configure::read('Install.secured')) { |
@@ -58,6 +58,9 @@ discard block |
||
58 | 58 | Configure::write('Security.cipherSeed', $seed); |
59 | 59 | } |
60 | 60 | |
61 | + /** |
|
62 | + * @param false|null $salt |
|
63 | + */ |
|
61 | 64 | protected function _createAdmin($salt) { |
62 | 65 | $User = ClassRegistry::init('User'); |
63 | 66 | $User->id = $User->field('id', ['username' => 'admin']); |