Completed
Push — php7-support ( 4474fe...119dc9 )
by Sam
06:04
created
model/fieldtypes/CompositeDBField.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -208,6 +208,9 @@
 block discarded – undo
208 208
 		return null;
209 209
 	}
210 210
 
211
+	/**
212
+	 * @param string $field
213
+	 */
211 214
 	public function hasField($field) {
212 215
 		$fields = $this->compositeDatabaseFields();
213 216
 		return isset($fields[$field]);
Please login to merge, or discard this patch.
model/fieldtypes/Currency.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -28,6 +28,9 @@  discard block
 block discarded – undo
28 28
 	 */
29 29
 	private static $currency_symbol = '$';
30 30
 
31
+	/**
32
+	 * @param string $name
33
+	 */
31 34
 	public function __construct($name = null, $wholeSize = 9, $decimalSize = 2, $defaultValue = 0) {
32 35
 		parent::__construct($name, $wholeSize, $decimalSize, $defaultValue);
33 36
 	}
@@ -51,6 +54,9 @@  discard block
 block discarded – undo
51 54
 		else return $val;
52 55
 	}
53 56
 
57
+	/**
58
+	 * @param string $value
59
+	 */
54 60
 	public function setValue($value, $record = null, $markChanged = true) {
55 61
 		$matches = null;
56 62
 		if(is_numeric($value)) {
Please login to merge, or discard this patch.
model/fieldtypes/Date.php 1 patch
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,6 +31,9 @@  discard block
 block discarded – undo
31 31
  */
32 32
 class DBDate extends DBField {
33 33
 
34
+	/**
35
+	 * @param string $value
36
+	 */
34 37
 	public function setValue($value, $record = null, $markChanged = true) {
35 38
 		if($value === false || $value === null || (is_string($value) && !strlen($value))) {
36 39
 			// don't try to evaluate empty values with strtotime() below, as it returns "1970-01-01" when it should be
@@ -113,7 +116,7 @@  discard block
 block discarded – undo
113 116
 
114 117
 	/**
115 118
 	 * Returns the day of the month.
116
-	 * @param boolean $includeOrdinals Include ordinal suffix to day, e.g. "th" or "rd"
119
+	 * @param boolean $includeOrdinal Include ordinal suffix to day, e.g. "th" or "rd"
117 120
 	 * @return string
118 121
 	 */
119 122
 	public function DayOfMonth($includeOrdinal = false) {
Please login to merge, or discard this patch.
model/fieldtypes/Datetime.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
 	 * Return a date and time formatted as per a CMS user's settings.
109 109
 	 *
110 110
 	 * @param Member $member
111
-	 * @return boolean | string A time and date pair formatted as per user-defined settings.
111
+	 * @return false|string | string A time and date pair formatted as per user-defined settings.
112 112
 	 */
113 113
 	public function FormatFromSettings($member = null) {
114 114
 		require_once 'Zend/Date.php';
Please login to merge, or discard this patch.
model/fieldtypes/DBField.php 1 patch
Doc Comments   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 	/**
237 237
 	 * Get the table this field belongs to, if assigned
238 238
 	 *
239
-	 * @return string|null
239
+	 * @return string
240 240
 	 */
241 241
 	public function getTable() {
242 242
 		return $this->tableName;
@@ -293,6 +293,7 @@  discard block
 block discarded – undo
293 293
 
294 294
 	/**
295 295
 	 * Saves this field to the given data object.
296
+	 * @param \DataObject $dataObject
296 297
 	 */
297 298
 	public function saveInto($dataObject) {
298 299
 		$fieldName = $this->name;
@@ -310,7 +311,7 @@  discard block
 block discarded – undo
310 311
 	 * Used by {@link SearchContext}, {@link ModelAdmin}, {@link DataObject::scaffoldFormFields()}
311 312
 	 *
312 313
 	 * @param string $title Optional. Localized title of the generated instance
313
-	 * @return FormField
314
+	 * @return TextField
314 315
 	 */
315 316
 	public function scaffoldFormField($title = null) {
316 317
 		$field = new TextField($this->name, $title);
@@ -325,7 +326,7 @@  discard block
 block discarded – undo
325 326
 	 * Used by {@link SearchContext}, {@link ModelAdmin}, {@link DataObject::scaffoldFormFields()}.
326 327
 	 *
327 328
 	 * @param string $title Optional. Localized title of the generated instance
328
-	 * @return FormField
329
+	 * @return TextField
329 330
 	 */
330 331
 	public function scaffoldSearchField($title = null) {
331 332
 		return $this->scaffoldFormField($title);
Please login to merge, or discard this patch.
model/fieldtypes/Decimal.php 1 patch
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	 * @param string $name
22 22
 	 * @param int $wholeSize
23 23
 	 * @param int $decimalSize
24
-	 * @param float $defaultValue
24
+	 * @param integer $defaultValue
25 25
 	 */
26 26
 	public function __construct($name = null, $wholeSize = 9, $decimalSize = 2, $defaultValue = 0) {
27 27
 		$this->wholeSize = is_int($wholeSize) ? $wholeSize : 9;
@@ -33,14 +33,14 @@  discard block
 block discarded – undo
33 33
 	}
34 34
 
35 35
 	/**
36
-	 * @return float
36
+	 * @return string
37 37
 	 */
38 38
 	public function Nice() {
39 39
 		return number_format($this->value, $this->decimalSize);
40 40
 	}
41 41
 
42 42
 	/**
43
-	 * @return int
43
+	 * @return double
44 44
 	 */
45 45
 	public function Int() {
46 46
 		return floor($this->value);
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	}
87 87
 
88 88
 	/**
89
-	 * @return float
89
+	 * @return integer
90 90
 	 */
91 91
 	public function nullValue() {
92 92
 		return 0;
Please login to merge, or discard this patch.
model/fieldtypes/HTMLText.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -47,6 +47,9 @@
 block discarded – undo
47 47
 
48 48
 	protected $whitelist = false;
49 49
 
50
+	/**
51
+	 * @param string $name
52
+	 */
50 53
 	public function __construct($name = null, $options = array()) {
51 54
 		if(is_string($options)) {
52 55
 			$options = array('whitelist' => $options);
Please login to merge, or discard this patch.
model/fieldtypes/Money.php 2 patches
Doc Comments   +8 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,6 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
 	/**
103 103
 	 * @param string
104
+	 * @param string|null $currency
104 105
 	 */
105 106
 	public function setCurrency($currency, $markChanged = true) {
106 107
 		$this->setField('Currency', $currency, $markChanged);
@@ -151,6 +152,8 @@  discard block
 block discarded – undo
151 152
 	}
152 153
 
153 154
 	/**
155
+	 * @param string $currency
156
+	 * @param string $locale
154 157
 	 * @return string
155 158
 	 */
156 159
 	public function getSymbol($currency = null, $locale = null) {
@@ -162,6 +165,8 @@  discard block
 block discarded – undo
162 165
 	}
163 166
 
164 167
 	/**
168
+	 * @param string $currency
169
+	 * @param string $locale
165 170
 	 * @return string
166 171
 	 */
167 172
 	public function getShortName($currency = null, $locale = null) {
@@ -172,6 +177,8 @@  discard block
 block discarded – undo
172 177
 	}
173 178
 
174 179
 	/**
180
+	 * @param string $currency
181
+	 * @param string $locale
175 182
 	 * @return string
176 183
 	 */
177 184
 	public function getCurrencyName($currency = null, $locale = null) {
@@ -202,7 +209,7 @@  discard block
 block discarded – undo
202 209
 	 * Used by {@link SearchContext}, {@link ModelAdmin}, {@link DataObject::scaffoldFormFields()}
203 210
 	 *
204 211
 	 * @param string $title Optional. Localized title of the generated instance
205
-	 * @return FormField
212
+	 * @return MoneyField
206 213
 	 */
207 214
 	public function scaffoldFormField($title = null) {
208 215
 		$field = new MoneyField($this->getName());
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace SilverStripe\Model\FieldType;
4 4
 
5
-use DB;
6 5
 use i18n;
7 6
 use Zend_Currency;
8 7
 use MoneyField;
Please login to merge, or discard this patch.
model/fieldtypes/Time.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -64,6 +64,9 @@
 block discarded – undo
64 64
 		if($this->value) return date($format, strtotime($this->value));
65 65
 	}
66 66
 
67
+	/**
68
+	 * @param string[] $parts
69
+	 */
67 70
 	public function TwelveHour( $parts ) {
68 71
 		$hour = $parts[1];
69 72
 		$min = $parts[2];
Please login to merge, or discard this patch.