@@ -27,6 +27,9 @@ |
||
| 27 | 27 | return $this->can(__FUNCTION__, $member, $context); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | + /** |
|
| 31 | + * @param string $perm |
|
| 32 | + */ |
|
| 30 | 33 | public function can($perm, $member = null, $context = array()) { |
| 31 | 34 | $perms = [ |
| 32 | 35 | "PERM_{$perm}", |
@@ -117,6 +117,9 @@ |
||
| 117 | 117 | Requirements::javascript(FRAMEWORK_ADMIN_DIR . '/client/dist/js/ModelAdmin.js'); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | + /** |
|
| 121 | + * @param string $action |
|
| 122 | + */ |
|
| 120 | 123 | public function Link($action = null) { |
| 121 | 124 | if(!$action) $action = $this->sanitiseClassName($this->modelClass); |
| 122 | 125 | return parent::Link($action); |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | /** |
| 25 | 25 | * Modify method visibility to public for testing |
| 26 | 26 | * |
| 27 | - * @param mixed $errors |
|
| 27 | + * @param string $errors |
|
| 28 | 28 | */ |
| 29 | 29 | public function setDisplayErrors($errors) |
| 30 | 30 | { |
@@ -33,6 +33,10 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | // Change function visibility to be testable directly |
| 36 | + |
|
| 37 | + /** |
|
| 38 | + * @param string $memstring |
|
| 39 | + */ |
|
| 36 | 40 | public function translateMemstring($memstring) { |
| 37 | 41 | return parent::translateMemstring($memstring); |
| 38 | 42 | } |
@@ -123,6 +123,10 @@ discard block |
||
| 123 | 123 | )); |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | + /** |
|
| 127 | + * @param DBHTMLText $result |
|
| 128 | + * @param string[] $expected |
|
| 129 | + */ |
|
| 126 | 130 | private function assertExpectedStrings($result, $expected) { |
| 127 | 131 | foreach ($expected as $expectedStr) { |
| 128 | 132 | $this->assertTrue( |
@@ -756,6 +760,10 @@ discard block |
||
| 756 | 760 | $this->assertEquals('A A1 A1 i A1 ii A2 A3', $rationalisedResult); |
| 757 | 761 | } |
| 758 | 762 | |
| 763 | + /** |
|
| 764 | + * @param string $a |
|
| 765 | + * @param string $b |
|
| 766 | + */ |
|
| 759 | 767 | public function assertEqualIgnoringWhitespace($a, $b) { |
| 760 | 768 | $this->assertEquals(preg_replace('/\s+/', '', $a), preg_replace('/\s+/', '', $b)); |
| 761 | 769 | } |
@@ -1375,6 +1383,11 @@ discard block |
||
| 1375 | 1383 | Config::inst()->update('SSViewer', 'source_file_comments', false); |
| 1376 | 1384 | Config::inst()->update('Director', 'environment_type', $origEnv); |
| 1377 | 1385 | } |
| 1386 | + |
|
| 1387 | + /** |
|
| 1388 | + * @param string $name |
|
| 1389 | + * @param string $expected |
|
| 1390 | + */ |
|
| 1378 | 1391 | private function _renderWithSourceFileComments($name, $expected) { |
| 1379 | 1392 | $viewer = new SSViewer(array($name)); |
| 1380 | 1393 | $data = new ArrayData(array()); |
@@ -843,6 +843,10 @@ discard block |
||
| 843 | 843 | * Assist with testing of specific protected methods |
| 844 | 844 | */ |
| 845 | 845 | class i18nTextCollectorTest_Collector extends i18nTextCollector implements TestOnly { |
| 846 | + |
|
| 847 | + /** |
|
| 848 | + * @param string $directory |
|
| 849 | + */ |
|
| 846 | 850 | public function getModules_Test($directory) { |
| 847 | 851 | return $this->getModules($directory); |
| 848 | 852 | } |
@@ -851,6 +855,9 @@ discard block |
||
| 851 | 855 | return $this->resolveDuplicateConflicts($entitiesByModule); |
| 852 | 856 | } |
| 853 | 857 | |
| 858 | + /** |
|
| 859 | + * @param string $module |
|
| 860 | + */ |
|
| 854 | 861 | public function getFileListForModule_Test($module) { |
| 855 | 862 | return $this->getFileListForModule($module); |
| 856 | 863 | } |
@@ -859,6 +866,9 @@ discard block |
||
| 859 | 866 | return $this->getConflicts($entitiesByModule); |
| 860 | 867 | } |
| 861 | 868 | |
| 869 | + /** |
|
| 870 | + * @param string $class |
|
| 871 | + */ |
|
| 862 | 872 | public function findModuleForClass_Test($class) { |
| 863 | 873 | return $this->findModuleForClass($class); |
| 864 | 874 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * left. |
| 100 | 100 | * @param array $attributes an array of attributes to include on the link. |
| 101 | 101 | * |
| 102 | - * @return boolean The result of the operation. |
|
| 102 | + * @return boolean|null The result of the operation. |
|
| 103 | 103 | */ |
| 104 | 104 | public static function add_link($code, $menuTitle, $url, $priority = -1, $attributes = null) { |
| 105 | 105 | return self::add_menu_item($code, $menuTitle, $url, null, $priority, $attributes); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | * have the rights to access some other part of the admin area. |
| 120 | 120 | * @param int $priority |
| 121 | 121 | * @param array $attributes an array of attributes to include on the link. |
| 122 | - * @return bool Success |
|
| 122 | + * @return boolean|null Success |
|
| 123 | 123 | */ |
| 124 | 124 | public static function add_menu_item($code, $menuTitle, $url, $controllerClass = null, $priority = -1, |
| 125 | 125 | $attributes = null) { |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | * have the rights to access some other part of the admin area. |
| 251 | 251 | * @param int $priority |
| 252 | 252 | * @param array $attributes an array of attributes to include on the link. |
| 253 | - * @return bool Success |
|
| 253 | + * @return boolean|null Success |
|
| 254 | 254 | */ |
| 255 | 255 | public static function replace_menu_item($code, $menuTitle, $url, $controllerClass = null, $priority = -1, |
| 256 | 256 | $attributes = null) { |
@@ -59,6 +59,9 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | // -- Public Static Methods -------------------------------------------------- |
| 61 | 61 | |
| 62 | + /** |
|
| 63 | + * @param string $js |
|
| 64 | + */ |
|
| 62 | 65 | public static function minify($js) {
|
| 63 | 66 | $jsmin = new JSMin($js); |
| 64 | 67 | return $jsmin->min(); |
@@ -82,6 +85,10 @@ discard block |
||
| 82 | 85 | action treats a string as a single character. Wow! |
| 83 | 86 | action recognizes a regular expression if it is preceded by ( or , or =. |
| 84 | 87 | */ |
| 88 | + |
|
| 89 | + /** |
|
| 90 | + * @param integer $d |
|
| 91 | + */ |
|
| 85 | 92 | protected function action($d) {
|
| 86 | 93 | switch($d) {
|
| 87 | 94 | case 1: |
@@ -160,6 +167,9 @@ discard block |
||
| 160 | 167 | } |
| 161 | 168 | } |
| 162 | 169 | |
| 170 | + /** |
|
| 171 | + * @return string |
|
| 172 | + */ |
|
| 163 | 173 | protected function get() {
|
| 164 | 174 | $c = $this->lookAhead; |
| 165 | 175 | $this->lookAhead = null; |
@@ -187,6 +197,10 @@ discard block |
||
| 187 | 197 | /* isAlphanum -- return true if the character is a letter, digit, underscore, |
| 188 | 198 | dollar sign, or non-ASCII character. |
| 189 | 199 | */ |
| 200 | + |
|
| 201 | + /** |
|
| 202 | + * @param string $c |
|
| 203 | + */ |
|
| 190 | 204 | protected function isAlphaNum($c) {
|
| 191 | 205 | return ord($c) > 126 || $c === '\\' || preg_match('/^[\w\$]$/', $c) === 1;
|
| 192 | 206 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | * Test if a cache is available or not (for the given id) |
| 57 | 57 | * |
| 58 | 58 | * @param string $id cache id |
| 59 | - * @return mixed false (a cache is not available) or "last modified" timestamp (int) of the available cache record |
|
| 59 | + * @return boolean false (a cache is not available) or "last modified" timestamp (int) of the available cache record |
|
| 60 | 60 | */ |
| 61 | 61 | public function test($id) |
| 62 | 62 | { |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | * - mtime : timestamp of last modification time |
| 193 | 193 | * |
| 194 | 194 | * @param string $id cache id |
| 195 | - * @return array array of metadatas (false if the cache id is not found) |
|
| 195 | + * @return boolean array of metadatas (false if the cache id is not found) |
|
| 196 | 196 | */ |
| 197 | 197 | public function getMetadatas($id) |
| 198 | 198 | { |
@@ -136,7 +136,7 @@ |
||
| 136 | 136 | * Helper method to calculate the correct class path |
| 137 | 137 | * |
| 138 | 138 | * @param string $class |
| 139 | - * @return False if not matched other wise the correct path |
|
| 139 | + * @return false|string if not matched other wise the correct path |
|
| 140 | 140 | */ |
| 141 | 141 | public function getClassPath($class) |
| 142 | 142 | { |