Code Duplication    Length = 6-6 lines in 2 locations

models/Assignment.php 1 location

@@ 90-95 (lines=6) @@
87
    {
88
        $manager = Yii::$app->getAuthManager();
89
        $avaliable = [];
90
        foreach ($manager->getRoles() as $item) {
91
            $avaliable[$item->name] = [
92
                'type' => 'role',
93
                'desc' => $item->description,
94
            ];
95
        }
96
97
        foreach ($manager->getPermissions() as $item) {
98
            if ($item->name[0] != '/') {

models/AuthItem.php 1 location

@@ 250-255 (lines=6) @@
247
        $manager = Yii::$app->getAuthManager();
248
        $avaliable = [];
249
        if ($this->type == Item::TYPE_ROLE) {
250
            foreach ($manager->getRoles() as $item) {
251
                $avaliable[$item->name] = [
252
                    'type' => 'role',
253
                    'desc' => $item->description,
254
                ];
255
            }
256
        }
257
258
        foreach ($manager->getPermissions() as $item) {