Code Duplication    Length = 11-11 lines in 3 locations

code/Model/EditableCustomRule.php 1 location

@@ 94-104 (lines=11) @@
91
     * @param array $context Virtual parameter to allow context to be passed in to check
92
     * @return bool
93
     */
94
    public function canCreate($member = null, $context = [])
95
    {
96
        // Check parent page
97
        $parent = $this->getCanCreateContext(func_get_args());
98
        if ($parent) {
99
            return $parent->canEdit($member);
100
        }
101
102
        // Fall back to secure admin permissions
103
        return parent::canCreate($member);
104
    }
105
106
    /**
107
     * Helper method to check the parent for this object

code/Model/EditableFormField.php 1 location

@@ 526-536 (lines=11) @@
523
     * @param array $context Virtual parameter to allow context to be passed in to check
524
     * @return bool
525
     */
526
    public function canCreate($member = null, $context = [])
527
    {
528
        // Check parent page
529
        $parent = $this->getCanCreateContext(func_get_args());
530
        if ($parent) {
531
            return $parent->canEdit($member);
532
        }
533
534
        // Fall back to secure admin permissions
535
        return parent::canCreate($member);
536
    }
537
538
    /**
539
     * Helper method to check the parent for this object

code/Model/Recipient/EmailRecipientCondition.php 1 location

@@ 112-122 (lines=11) @@
109
     * @param array $context Virtual parameter to allow context to be passed in to check
110
     * @return bool
111
     */
112
    public function canCreate($member = null, $context = [])
113
    {
114
        // Check parent page
115
        $parent = $this->getCanCreateContext(func_get_args());
116
        if ($parent) {
117
            return $parent->canEdit($member);
118
        }
119
120
        // Fall back to secure admin permissions
121
        return parent::canCreate($member);
122
    }
123
124
    /**
125
     * Helper method to check the parent for this object