Code Duplication    Length = 35-38 lines in 2 locations

src/elements/ElementWithHandle.php 1 location

@@ 31-68 (lines=38) @@
28
    /**
29
     * @inheritdoc
30
     */
31
    public function rules()
32
    {
33
34
        return array_merge(
35
            parent::rules(),
36
            [
37
                [
38
                    [
39
                        'handle'
40
                    ],
41
                    HandleValidator::class
42
                ],
43
                [
44
                    [
45
                        'handle'
46
                    ],
47
                    'required'
48
                ],
49
                [
50
                    [
51
                        'handle'
52
                    ],
53
                    'string',
54
                    'max' => 255
55
                ],
56
                [
57
                    [
58
                        'handle'
59
                    ],
60
                    'safe',
61
                    'on' => [
62
                        ElementHelper::SCENARIO_DEFAULT
63
                    ]
64
                ]
65
            ]
66
        );
67
68
    }
69
70
    /**
71
     * @inheritdoc

src/models/traits/ModelWithHandle.php 1 location

@@ 30-64 (lines=35) @@
27
    /**
28
     * @inheritdoc
29
     */
30
    public function handleRules()
31
    {
32
33
        return [
34
            [
35
                [
36
                    'handle'
37
                ],
38
                HandleValidator::class
39
            ],
40
            [
41
                [
42
                    'handle'
43
                ],
44
                'required'
45
            ],
46
            [
47
                [
48
                    'handle'
49
                ],
50
                'string',
51
                'max' => 255
52
            ],
53
            [
54
                [
55
                    'handle'
56
                ],
57
                'safe',
58
                'on' => [
59
                    ModelHelper::SCENARIO_DEFAULT
60
                ]
61
            ]
62
        ];
63
64
    }
65
66
    /**
67
     * @inheritdoc