Code Duplication    Length = 7-7 lines in 2 locations

models/Category.php 1 location

@@ 75-81 (lines=7) @@
72
            [
73
                'parentId',
74
                'filter',
75
                'filter' => function ($value) {
76
                    if (empty($value)) {
77
                        return null;
78
                    } else {
79
                        return MenuWidget::checkNewParentId($this, $value) ? $value : $this->getOldAttribute('parentId');
80
                    }
81
                }
82
            ],
83
            [
84
                'alias',

models/Page.php 1 location

@@ 108-114 (lines=7) @@
105
            [
106
                'parentId',
107
                'filter',
108
                'filter' => function ($value) {
109
                    if (empty($value)) {
110
                        return null;
111
                    } else {
112
                        return MenuWidget::checkNewParentId($this, $value) ? $value : $this->getOldAttribute('parentId');
113
                    }
114
                }
115
            ],
116
            [
117
                'alias',