Code Duplication    Length = 15-16 lines in 4 locations

src/Forms/DateField.php 2 locations

@@ 319-333 (lines=15) @@
316
     * @param mixed $data
317
     * @return $this
318
     */
319
    public function setSubmittedValue($value, $data = null)
320
    {
321
        // Save raw value for later validation
322
        $this->rawValue = $value;
323
324
        // Null case
325
        if (!$value) {
326
            $this->value = null;
327
            return $this;
328
        }
329
330
        // Parse from submitted value
331
        $this->value = $this->frontendToInternal($value);
332
        return $this;
333
    }
334
335
    /**
336
     * Assign value based on {@link $datetimeFormat}, which might be localised.
@@ 344-358 (lines=15) @@
341
     * @param mixed $data
342
     * @return $this
343
     */
344
    public function setValue($value, $data = null)
345
    {
346
        // Save raw value for later validation
347
        $this->rawValue = $value;
348
349
        // Null case
350
        if (!$value) {
351
            $this->value = null;
352
            return $this;
353
        }
354
355
        // Re-run through formatter to tidy up (e.g. remove time component)
356
        $this->value = $this->tidyInternal($value);
357
        return $this;
358
    }
359
360
    public function Value()
361
    {

src/Forms/DatetimeField.php 1 location

@@ 155-170 (lines=16) @@
152
     * @param mixed $data
153
     * @return $this
154
     */
155
    public function setSubmittedValue($value, $data = null)
156
    {
157
        // Save raw value for later validation
158
        $this->rawValue = $value;
159
160
        // Null case
161
        if (!$value) {
162
            $this->value = null;
163
            return $this;
164
        }
165
166
        // Parse from submitted value
167
        $this->value = $this->frontendToInternal($value);
168
169
        return $this;
170
    }
171
172
    /**
173
     * Convert frontend date to the internal representation (ISO 8601).

src/Forms/TimeField.php 1 location

@@ 274-288 (lines=15) @@
271
     * @param mixed $data
272
     * @return $this
273
     */
274
    public function setValue($value, $data = null)
275
    {
276
        // Save raw value for later validation
277
        $this->rawValue = $value;
278
279
        // Null case
280
        if (!$value) {
281
            $this->value = null;
282
            return $this;
283
        }
284
285
        // Re-run through formatter to tidy up (e.g. remove date component)
286
        $this->value = $this->tidyInternal($value);
287
        return $this;
288
    }
289
290
    public function Value()
291
    {