Code Duplication    Length = 8-8 lines in 2 locations

src/Forms/FormField.php 1 location

@@ 853-860 (lines=8) @@
850
        return $form->getSecurityToken()->isEnabled();
851
    }
852
853
    public function castingHelper($field)
854
    {
855
        // Override casting for field message
856
        if (strcasecmp($field, 'Message') === 0 && ($helper = $this->getMessageCastingHelper())) {
857
            return $helper;
858
        }
859
        return parent::castingHelper($field);
860
    }
861
862
    /**
863
     * Set the custom error message to show instead of the default format.

src/Forms/Form.php 1 location

@@ 519-526 (lines=8) @@
516
        return $this;
517
    }
518
519
    public function castingHelper($field)
520
    {
521
        // Override casting for field message
522
        if (strcasecmp($field, 'Message') === 0 && ($helper = $this->getMessageCastingHelper())) {
523
            return $helper;
524
        }
525
        return parent::castingHelper($field);
526
    }
527
528
    /**
529
     * set up the default classes for the form. This is done on construct so that the default classes can be removed