@@ -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()); |
@@ -115,6 +115,9 @@ |
||
115 | 115 | $this->query("ALTER TABLE \"$tableName\" $alterations"); |
116 | 116 | } |
117 | 117 | |
118 | + /** |
|
119 | + * @param string $tableName |
|
120 | + */ |
|
118 | 121 | public function isView($tableName) { |
119 | 122 | $info = $this->query("SHOW /*!50002 FULL*/ TABLES LIKE '$tableName'")->record(); |
120 | 123 | return $info && strtoupper($info['Table_type']) == 'VIEW'; |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | /** |
108 | 108 | * Gets the url to return to after build |
109 | 109 | * |
110 | - * @return string|null |
|
110 | + * @return string |
|
111 | 111 | */ |
112 | 112 | protected function getReturnURL() { |
113 | 113 | $url = $this->request->getVar('returnURL'); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | /** |
153 | 153 | * Returns the timestamp of the time that the database was last built |
154 | 154 | * |
155 | - * @return string Returns the timestamp of the time that the database was |
|
155 | + * @return integer|null Returns the timestamp of the time that the database was |
|
156 | 156 | * last built |
157 | 157 | */ |
158 | 158 | public static function lastBuilt() { |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | * Returns a new DataList instance with the specified query parameter assigned |
158 | 158 | * |
159 | 159 | * @param string|array $keyOrArray Either the single key to set, or an array of key value pairs to set |
160 | - * @param mixed $val If $keyOrArray is not an array, this is the value to set |
|
160 | + * @param string $val If $keyOrArray is not an array, this is the value to set |
|
161 | 161 | * @return DataList |
162 | 162 | */ |
163 | 163 | public function setDataQueryParam($keyOrArray, $val = null) { |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | * Check if the given field specification could be interpreted as an unquoted relation name |
521 | 521 | * |
522 | 522 | * @param string $field |
523 | - * @return bool |
|
523 | + * @return integer |
|
524 | 524 | */ |
525 | 525 | protected function isValidRelationName($field) { |
526 | 526 | return preg_match('/^[A-Z0-9._]+$/i', $field); |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | * @param int $order A numerical index to control the order that joins are added to the query; lower order values |
636 | 636 | * will cause the query to appear first. The default is 20, and joins created automatically by the |
637 | 637 | * ORM have a value of 10. |
638 | - * @param array $parameters Any additional parameters if the join is a parameterised subquery |
|
638 | + * @param string[] $parameters Any additional parameters if the join is a parameterised subquery |
|
639 | 639 | * @return DataList |
640 | 640 | */ |
641 | 641 | public function innerJoin($table, $onClause, $alias = null, $order = 20, $parameters = array()) { |
@@ -653,7 +653,7 @@ discard block |
||
653 | 653 | * @param int $order A numerical index to control the order that joins are added to the query; lower order values |
654 | 654 | * will cause the query to appear first. The default is 20, and joins created automatically by the |
655 | 655 | * ORM have a value of 10. |
656 | - * @param array $parameters Any additional parameters if the join is a parameterised subquery |
|
656 | + * @param string[] $parameters Any additional parameters if the join is a parameterised subquery |
|
657 | 657 | * @return DataList |
658 | 658 | */ |
659 | 659 | public function leftJoin($table, $onClause, $alias = null, $order = 20, $parameters = array()) { |
@@ -780,7 +780,7 @@ discard block |
||
780 | 780 | * Return the maximum value of the given field in this DataList |
781 | 781 | * |
782 | 782 | * @param string $fieldName |
783 | - * @return mixed |
|
783 | + * @return string |
|
784 | 784 | */ |
785 | 785 | public function max($fieldName) { |
786 | 786 | return $this->dataQuery->max($fieldName); |
@@ -790,7 +790,7 @@ discard block |
||
790 | 790 | * Return the minimum value of the given field in this DataList |
791 | 791 | * |
792 | 792 | * @param string $fieldName |
793 | - * @return mixed |
|
793 | + * @return string |
|
794 | 794 | */ |
795 | 795 | public function min($fieldName) { |
796 | 796 | return $this->dataQuery->min($fieldName); |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | * Return the average value of the given field in this DataList |
801 | 801 | * |
802 | 802 | * @param string $fieldName |
803 | - * @return mixed |
|
803 | + * @return string |
|
804 | 804 | */ |
805 | 805 | public function avg($fieldName) { |
806 | 806 | return $this->dataQuery->avg($fieldName); |
@@ -810,7 +810,7 @@ discard block |
||
810 | 810 | * Return the sum of the values of the given field in this DataList |
811 | 811 | * |
812 | 812 | * @param string $fieldName |
813 | - * @return mixed |
|
813 | + * @return string |
|
814 | 814 | */ |
815 | 815 | public function sum($fieldName) { |
816 | 816 | return $this->dataQuery->sum($fieldName); |
@@ -862,7 +862,7 @@ discard block |
||
862 | 862 | /** |
863 | 863 | * Restrict the columns to fetch into this DataList |
864 | 864 | * |
865 | - * @param array $queriedColumns |
|
865 | + * @param string[] $queriedColumns |
|
866 | 866 | * @return DataList |
867 | 867 | */ |
868 | 868 | public function setQueriedColumns($queriedColumns) { |
@@ -1135,7 +1135,7 @@ discard block |
||
1135 | 1135 | /** |
1136 | 1136 | * Returns item stored in list with index $key |
1137 | 1137 | * |
1138 | - * @param mixed $key |
|
1138 | + * @param integer $key |
|
1139 | 1139 | * @return DataObject |
1140 | 1140 | */ |
1141 | 1141 | public function offsetGet($key) { |
@@ -186,6 +186,9 @@ |
||
186 | 186 | return $classNames; |
187 | 187 | } |
188 | 188 | |
189 | + /** |
|
190 | + * @param \DBClassNameTest_ObjectSubClass $record |
|
191 | + */ |
|
189 | 192 | public function setValue($value, $record = null, $markChanged = true) { |
190 | 193 | parent::setValue($value, $record, $markChanged); |
191 | 194 |
@@ -205,6 +205,9 @@ |
||
205 | 205 | return null; |
206 | 206 | } |
207 | 207 | |
208 | + /** |
|
209 | + * @param string $field |
|
210 | + */ |
|
208 | 211 | public function hasField($field) { |
209 | 212 | $fields = $this->compositeDatabaseFields(); |
210 | 213 | return isset($fields[$field]); |