Code Duplication    Length = 7-7 lines in 2 locations

models/Category.php 1 location

@@ 84-90 (lines=7) @@
81
            [
82
                'parentId',
83
                'filter',
84
                'filter' => function ($value) {
85
                    if (empty($value)) {
86
                        return null;
87
                    } else {
88
                        return MenuWidget::checkNewParentId($this, $value) ? $value : $this->getOldAttribute('parentId');
89
                    }
90
                }
91
            ],
92
            [
93
                'alias',

models/Page.php 1 location

@@ 122-128 (lines=7) @@
119
            [
120
                'parentId',
121
                'filter',
122
                'filter' => function ($value) {
123
                    if (empty($value)) {
124
                        return null;
125
                    } else {
126
                        return MenuWidget::checkNewParentId($this, $value) ? $value : $this->getOldAttribute('parentId');
127
                    }
128
                }
129
            ],
130
            [
131
                'alias',