@@ -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 | } |
@@ -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) { |
@@ -5,7 +5,6 @@ |
||
5 | 5 | use SilverStripe\Filesystem\ImageManipulation; |
6 | 6 | use SilverStripe\Filesystem\Storage\AssetContainer; |
7 | 7 | use SilverStripe\Filesystem\Storage\AssetStore; |
8 | - |
|
9 | 8 | use Injector; |
10 | 9 | use AssetField; |
11 | 10 | use File; |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | /** |
253 | 253 | * Gets the combined configuration of all LeafAndMain subclasses required by the client app. |
254 | 254 | * |
255 | - * @return array |
|
255 | + * @return string |
|
256 | 256 | * |
257 | 257 | * WARNING: Experimental API |
258 | 258 | */ |
@@ -691,7 +691,7 @@ discard block |
||
691 | 691 | * |
692 | 692 | * @param string $url |
693 | 693 | * @param int $code |
694 | - * @return HTTPResponse|string |
|
694 | + * @return string|null |
|
695 | 695 | */ |
696 | 696 | public function redirect($url, $code=302) { |
697 | 697 | if($this->getRequest()->isAjax()) { |
@@ -969,7 +969,7 @@ discard block |
||
969 | 969 | * {@link SSViewer::get_templates_by_class()} |
970 | 970 | * |
971 | 971 | * @param string $suffix |
972 | - * @return array |
|
972 | + * @return string |
|
973 | 973 | */ |
974 | 974 | public function getTemplatesWithSuffix($suffix) { |
975 | 975 | $templates = SSViewer::get_templates_by_class(get_class($this), $suffix, __CLASS__); |
@@ -2039,7 +2039,7 @@ discard block |
||
2039 | 2039 | } |
2040 | 2040 | |
2041 | 2041 | /** |
2042 | - * @return String |
|
2042 | + * @return DBField |
|
2043 | 2043 | */ |
2044 | 2044 | public function Locale() { |
2045 | 2045 | return DBField::create_field('Locale', i18n::get_locale()); |
@@ -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 | } |
@@ -128,6 +128,10 @@ discard block |
||
128 | 128 | )); |
129 | 129 | } |
130 | 130 | |
131 | + /** |
|
132 | + * @param DBHTMLText $result |
|
133 | + * @param string[] $expected |
|
134 | + */ |
|
131 | 135 | private function assertExpectedStrings($result, $expected) { |
132 | 136 | foreach ($expected as $expectedStr) { |
133 | 137 | $this->assertTrue( |
@@ -787,6 +791,10 @@ discard block |
||
787 | 791 | $this->assertEquals('A A1 A1 i A1 ii A2 A3', $rationalisedResult); |
788 | 792 | } |
789 | 793 | |
794 | + /** |
|
795 | + * @param string $a |
|
796 | + * @param string $b |
|
797 | + */ |
|
790 | 798 | public function assertEqualIgnoringWhitespace($a, $b) { |
791 | 799 | $this->assertEquals(preg_replace('/\s+/', '', $a), preg_replace('/\s+/', '', $b)); |
792 | 800 | } |
@@ -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()); |
@@ -23,6 +23,10 @@ discard block |
||
23 | 23 | */ |
24 | 24 | protected $group; |
25 | 25 | |
26 | + /** |
|
27 | + * @param SecurityAdmin $controller |
|
28 | + * @param string $name |
|
29 | + */ |
|
26 | 30 | public function __construct($controller, $name, $fields = null, $actions = null, $validator = null) { |
27 | 31 | if(!$fields) { |
28 | 32 | $helpHtml = _t( |
@@ -109,7 +113,7 @@ discard block |
||
109 | 113 | } |
110 | 114 | |
111 | 115 | /** |
112 | - * @param $group Group |
|
116 | + * @param Group $group Group |
|
113 | 117 | */ |
114 | 118 | public function setGroup($group) { |
115 | 119 | $this->group = $group; |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | /** |
252 | 252 | * @see SecurityAdmin_MemberImportForm |
253 | 253 | * |
254 | - * @return Form |
|
254 | + * @return null|MemberImportForm |
|
255 | 255 | */ |
256 | 256 | public function MemberImportForm() { |
257 | 257 | if(!Permission::check('ADMIN')) { |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | * @see SecurityAdmin_MemberImportForm |
287 | 287 | * |
288 | 288 | * @skipUpgrade |
289 | - * @return Form |
|
289 | + * @return null|GroupImportForm |
|
290 | 290 | */ |
291 | 291 | public function GroupImportForm() { |
292 | 292 | if(!Permission::check('ADMIN')) { |
@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | use SilverStripe\Core\Convert; |
4 | -use SilverStripe\Core\Config\Config; |
|
5 | 4 | use SilverStripe\Dev\SapphireTest; |
6 | 5 | use SilverStripe\View\Parsers\URLSegmentFilter; |
7 | 6 |
@@ -1,6 +1,5 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -use SilverStripe\ORM\DataObject; |
|
4 | 3 | use SilverStripe\Security\Member; |
5 | 4 | use SilverStripe\Security\Permission; |
6 | 5 | use SilverStripe\Security\Security; |