@@ -2,8 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace SilverStripe\Framework\Logging; |
4 | 4 | |
5 | -use Monolog\Logger; |
|
6 | -use Monolog\Handler\AbstractProcessingHandler; |
|
7 | 5 | use Monolog\Formatter\FormatterInterface; |
8 | 6 | |
9 | 7 | /** |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | * |
388 | 388 | * Note that columns may be double quoted as per ANSI sql standard |
389 | 389 | * |
390 | - * @return DataList |
|
390 | + * @return ArrayList |
|
391 | 391 | * @see SS_List::sort() |
392 | 392 | * @example $list->sort('Name'); // default ASC sorting |
393 | 393 | * @example $list->sort('Name DESC'); // DESC sorting |
@@ -523,6 +523,9 @@ discard block |
||
523 | 523 | return $list; |
524 | 524 | } |
525 | 525 | |
526 | + /** |
|
527 | + * @param integer $id |
|
528 | + */ |
|
526 | 529 | public function byID($id) { |
527 | 530 | $firstElement = $this->filter("ID", $id)->first(); |
528 | 531 | |
@@ -624,7 +627,6 @@ discard block |
||
624 | 627 | /** |
625 | 628 | * Returns whether an item with $key exists |
626 | 629 | * |
627 | - * @param mixed $key |
|
628 | 630 | * @return bool |
629 | 631 | */ |
630 | 632 | public function offsetExists($offset) { |
@@ -634,7 +636,6 @@ discard block |
||
634 | 636 | /** |
635 | 637 | * Returns item stored in list with index $key |
636 | 638 | * |
637 | - * @param mixed $key |
|
638 | 639 | * @return DataObject |
639 | 640 | */ |
640 | 641 | public function offsetGet($offset) { |
@@ -644,7 +645,6 @@ discard block |
||
644 | 645 | /** |
645 | 646 | * Set an item with the key in $key |
646 | 647 | * |
647 | - * @param mixed $key |
|
648 | 648 | * @param mixed $value |
649 | 649 | */ |
650 | 650 | public function offsetSet($offset, $value) { |
@@ -658,7 +658,6 @@ discard block |
||
658 | 658 | /** |
659 | 659 | * Unset an item with the key in $key |
660 | 660 | * |
661 | - * @param mixed $key |
|
662 | 661 | */ |
663 | 662 | public function offsetUnset($offset) { |
664 | 663 | unset($this->items[$offset]); |
@@ -406,6 +406,7 @@ discard block |
||
406 | 406 | * - minutes |
407 | 407 | * - seconds |
408 | 408 | * This includes the singular forms as well |
409 | + * @param string $date |
|
409 | 410 | * @return string SQL datetime expression to query for a datetime (YYYY-MM-DD hh:mm:ss) which is the result of |
410 | 411 | * the addition |
411 | 412 | */ |
@@ -419,6 +420,7 @@ discard block |
||
419 | 420 | * e.g. '"SiteTree"."Created"' |
420 | 421 | * @param string $date2 to be substracted of $date1, can be either 'now', literal datetime |
421 | 422 | * like '1973-10-14 10:30:00' or field name, e.g. '"SiteTree"."Created"' |
423 | + * @param string $date1 |
|
422 | 424 | * @return string SQL datetime expression to query for the interval between $date1 and $date2 in seconds which |
423 | 425 | * is the result of the substraction |
424 | 426 | */ |
@@ -646,7 +648,7 @@ discard block |
||
646 | 648 | * @param boolean $create Flag indicating whether the database should be created |
647 | 649 | * if it doesn't exist. If $create is false and the database doesn't exist |
648 | 650 | * then an error will be raised |
649 | - * @param int|boolean $errorLevel The level of error reporting to enable for the query, or false if no error |
|
651 | + * @param boolean $errorLevel The level of error reporting to enable for the query, or false if no error |
|
650 | 652 | * should be raised |
651 | 653 | * @return boolean Flag indicating success |
652 | 654 | */ |
@@ -681,7 +683,7 @@ discard block |
||
681 | 683 | /** |
682 | 684 | * Returns the name of the currently selected database |
683 | 685 | * |
684 | - * @return string|null Name of the selected database, or null if none selected |
|
686 | + * @return string Name of the selected database, or null if none selected |
|
685 | 687 | */ |
686 | 688 | public function getSelectedDatabase() { |
687 | 689 | return $this->connector->getSelectedDatabase(); |
@@ -806,6 +808,7 @@ discard block |
||
806 | 808 | |
807 | 809 | /** |
808 | 810 | * @deprecated since version 4.0 Use DB::field_list instead |
811 | + * @param string $table |
|
809 | 812 | */ |
810 | 813 | public function fieldList($table) { |
811 | 814 | Deprecation::notice('4.0', 'Use DB::field_list instead'); |
@@ -38,7 +38,6 @@ discard block |
||
38 | 38 | /** |
39 | 39 | * Injector injection point for database controller |
40 | 40 | * |
41 | - * @param SS_Database $connector |
|
42 | 41 | */ |
43 | 42 | public function setDatabase(SS_Database $database) { |
44 | 43 | $this->database = $database; |
@@ -104,6 +103,7 @@ discard block |
||
104 | 103 | * |
105 | 104 | * @var callable $callback |
106 | 105 | * @throws Exception |
106 | + * @param Closure $callback |
|
107 | 107 | */ |
108 | 108 | public function schemaUpdate($callback) { |
109 | 109 | // Begin schema update |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | /** |
477 | 477 | * Given an index spec determines the index type |
478 | 478 | * |
479 | - * @param array|string $spec |
|
479 | + * @param string $spec |
|
480 | 480 | * @return string |
481 | 481 | */ |
482 | 482 | protected function determineIndexType($spec) { |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | /** |
545 | 545 | * Returns true if the given table is exists in the current database |
546 | 546 | * |
547 | - * @param string $table Name of table to check |
|
547 | + * @param string $tableName Name of table to check |
|
548 | 548 | * @return boolean Flag indicating existence of table |
549 | 549 | */ |
550 | 550 | abstract public function hasTable($tableName); |
@@ -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() { |
@@ -50,6 +50,7 @@ |
||
50 | 50 | * |
51 | 51 | * @param DataObject (Optional) |
52 | 52 | * @param DataObject |
53 | + * @param DataObject|null $fromRecord |
|
53 | 54 | */ |
54 | 55 | public function __construct($fromRecord, DataObject $toRecord) { |
55 | 56 | if(!$toRecord) user_error("DataDifferencer constructed without a toRecord", E_USER_WARNING); |
@@ -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) { |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | * The destinationObject must be written to the database already and have an ID. Writing is performed |
543 | 543 | * automatically when adding the new relations. |
544 | 544 | * |
545 | - * @param $sourceObject the source object to duplicate from |
|
545 | + * @param DataObject $sourceObject the source object to duplicate from |
|
546 | 546 | * @param $destinationObject the destination object to populate with the duplicated relations |
547 | 547 | * @return DataObject with the new many_many relations copied in |
548 | 548 | */ |
@@ -947,6 +947,7 @@ discard block |
||
947 | 947 | * @param $includeRelations Boolean Merge any existing relations (optional) |
948 | 948 | * @param $overwriteWithEmpty Boolean Overwrite existing left values with empty right values. |
949 | 949 | * Only applicable with $priority='right'. (optional) |
950 | + * @param DataObject|null $rightObj |
|
950 | 951 | * @return Boolean |
951 | 952 | */ |
952 | 953 | public function merge($rightObj, $priority = 'right', $includeRelations = true, $overwriteWithEmpty = false) { |
@@ -1634,7 +1635,7 @@ discard block |
||
1634 | 1635 | /** |
1635 | 1636 | * Find the foreign class of a relation on this DataObject, regardless of the relation type. |
1636 | 1637 | * |
1637 | - * @param $relationName Relation name. |
|
1638 | + * @param string $relationName Relation name. |
|
1638 | 1639 | * @return string Class name, or null if not found. |
1639 | 1640 | */ |
1640 | 1641 | public function getRelationClass($relationName) { |
@@ -2210,6 +2211,7 @@ discard block |
||
2210 | 2211 | * |
2211 | 2212 | * This is experimental, and is currently only a Postgres-specific enhancement. |
2212 | 2213 | * |
2214 | + * @param string $class |
|
2213 | 2215 | * @return array or false |
2214 | 2216 | */ |
2215 | 2217 | public function database_extensions($class){ |
@@ -2857,7 +2859,7 @@ discard block |
||
2857 | 2859 | * </code> |
2858 | 2860 | * |
2859 | 2861 | * @param string $methodName Method on the same object, e.g. {@link canEdit()} |
2860 | - * @param Member|int $member |
|
2862 | + * @param DataObject|null $member |
|
2861 | 2863 | * @param array $context Optional context |
2862 | 2864 | * @return boolean|null |
2863 | 2865 | */ |
@@ -3013,7 +3015,7 @@ discard block |
||
3013 | 3015 | * Traverses to a field referenced by relationships between data objects, returning the value |
3014 | 3016 | * The path to the related field is specified with dot separated syntax (eg: Parent.Child.Child.FieldName) |
3015 | 3017 | * |
3016 | - * @param $fieldName string |
|
3018 | + * @param string $fieldName string |
|
3017 | 3019 | * @return string | null - will return null on a missing value |
3018 | 3020 | */ |
3019 | 3021 | public function relField($fieldName) { |
@@ -3082,7 +3084,7 @@ discard block |
||
3082 | 3084 | * @param string $callerClass The class of objects to be returned |
3083 | 3085 | * @param string|array $filter A filter to be inserted into the WHERE clause. |
3084 | 3086 | * Supports parameterised queries. See SQLSelect::addWhere() for syntax examples. |
3085 | - * @param string|array $sort A sort expression to be inserted into the ORDER |
|
3087 | + * @param string $sort A sort expression to be inserted into the ORDER |
|
3086 | 3088 | * BY clause. If omitted, self::$default_sort will be used. |
3087 | 3089 | * @param string $join Deprecated 3.0 Join clause. Use leftJoin($table, $joinClause) instead. |
3088 | 3090 | * @param string|array $limit A limit expression to be inserted into the LIMIT clause. |
@@ -3288,6 +3290,7 @@ discard block |
||
3288 | 3290 | |
3289 | 3291 | /** |
3290 | 3292 | * @see $sourceQueryParams |
3293 | + * @param string $key |
|
3291 | 3294 | * @return Mixed |
3292 | 3295 | */ |
3293 | 3296 | public function getSourceQueryParam($key) { |
@@ -1,9 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -use SilverStripe\Model\FieldType\DBPolymorphicForeignKey; |
|
4 | 3 | use SilverStripe\Model\FieldType\DBField; |
5 | 4 | use SilverStripe\Model\FieldType\DBDatetime; |
6 | -use SilverStripe\Model\FieldType\DBPrimaryKey; |
|
7 | 5 | use SilverStripe\Model\FieldType\DBComposite; |
8 | 6 | |
9 | 7 | /** |