Code Duplication    Length = 9-9 lines in 4 locations

lib/Cake/View/Helper/FormHelper.php 4 locations

@@ 2140-2148 (lines=9) @@
2137
		$attributes += array('empty' => true, 'value' => null);
2138
		$attributes = $this->_dateTimeSelected('day', $fieldName, $attributes);
2139
2140
		if (strlen($attributes['value']) > 2) {
2141
			$date = date_create($attributes['value']);
2142
			$attributes['value'] = null;
2143
			if ($date) {
2144
				$attributes['value'] = $date->format('d');
2145
			}
2146
		} elseif ($attributes['value'] === false) {
2147
			$attributes['value'] = null;
2148
		}
2149
		return $this->select($fieldName . ".day", $this->_generateOptions('day'), $attributes);
2150
	}
2151
@@ 2191-2199 (lines=9) @@
2188
			}
2189
		}
2190
2191
		if (strlen($attributes['value']) > 4 || $attributes['value'] === 'now') {
2192
			$date = date_create($attributes['value']);
2193
			$attributes['value'] = null;
2194
			if ($date) {
2195
				$attributes['value'] = $date->format('Y');
2196
			}
2197
		} elseif ($attributes['value'] === false) {
2198
			$attributes['value'] = null;
2199
		}
2200
		$yearOptions = array('value' => $attributes['value'], 'min' => $minYear, 'max' => $maxYear, 'order' => 'desc');
2201
		if (isset($attributes['orderYear'])) {
2202
			$yearOptions['order'] = $attributes['orderYear'];
@@ 2231-2239 (lines=9) @@
2228
		$attributes += array('empty' => true, 'value' => null);
2229
		$attributes = $this->_dateTimeSelected('month', $fieldName, $attributes);
2230
2231
		if (strlen($attributes['value']) > 2) {
2232
			$date = date_create($attributes['value']);
2233
			$attributes['value'] = null;
2234
			if ($date) {
2235
				$attributes['value'] = $date->format('m');
2236
			}
2237
		} elseif ($attributes['value'] === false) {
2238
			$attributes['value'] = null;
2239
		}
2240
		$defaults = array('monthNames' => true);
2241
		$attributes = array_merge($defaults, (array)$attributes);
2242
		$monthNames = $attributes['monthNames'];
@@ 2318-2326 (lines=9) @@
2315
		$attributes += array('empty' => true, 'value' => null);
2316
		$attributes = $this->_dateTimeSelected('min', $fieldName, $attributes);
2317
2318
		if (strlen($attributes['value']) > 2) {
2319
			$date = date_create($attributes['value']);
2320
			$attributes['value'] = null;
2321
			if ($date) {
2322
				$attributes['value'] = $date->format('i');
2323
			}
2324
		} elseif ($attributes['value'] === false) {
2325
			$attributes['value'] = null;
2326
		}
2327
		$minuteOptions = array();
2328
2329
		if (isset($attributes['interval'])) {