Code Duplication    Length = 11-11 lines in 2 locations

src/Charcoal/Property/AbstractProperty.php 1 location

@@ 890-900 (lines=11) @@
887
    /**
888
     * @return boolean
889
     */
890
    public function validateRequired()
891
    {
892
        $val = $this->val();
893
        if ($this['required'] && empty($val) && !is_numeric($val)) {
894
            $this->validator()->error('Value is required.', 'required');
895
896
            return false;
897
        }
898
899
        return true;
900
    }
901
902
    /**
903
     * @return boolean

src/Charcoal/Property/StringProperty.php 1 location

@@ 440-450 (lines=11) @@
437
     *
438
     * @return boolean
439
     */
440
    public function validateAllowEmpty()
441
    {
442
        $val = $this->val();
443
        if (!$this['allowEmpty'] && empty($val) && !is_numeric($val)) {
444
            $this->validator()->error('Value can not be empty.', 'allowEmpty');
445
446
            return false;
447
        }
448
449
        return true;
450
    }
451
452
    /**
453
     * Parse a value. (From `AbstractProperty`).