Code Duplication    Length = 8-8 lines in 2 locations

src/Validation/Validator.php 2 locations

@@ 2378-2385 (lines=8) @@
2375
     * @param bool $newRecord whether the data to be validated is new or to be updated.
2376
     * @return bool
2377
     */
2378
    public function isEmptyAllowed($field, $newRecord)
2379
    {
2380
        $providers = $this->_providers;
2381
        $data = [];
2382
        $context = compact('data', 'newRecord', 'field', 'providers');
2383
2384
        return $this->_canBeEmpty($this->field($field), $context);
2385
    }
2386
2387
    /**
2388
     * Returns whether or not a field can be left out for a new or already existing
@@ 2395-2402 (lines=8) @@
2392
     * @param bool $newRecord Whether the data to be validated is new or to be updated.
2393
     * @return bool
2394
     */
2395
    public function isPresenceRequired($field, $newRecord)
2396
    {
2397
        $providers = $this->_providers;
2398
        $data = [];
2399
        $context = compact('data', 'newRecord', 'field', 'providers');
2400
2401
        return !$this->_checkPresence($this->field($field), $context);
2402
    }
2403
2404
    /**
2405
     * Returns whether or not a field matches against a regular expression.