| Conditions | 4 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 56 | protected static function detectLoop($parent, $child) |
||
| 57 | { |
||
| 58 | $auth = Yii::$app->authManager; |
||
| 59 | if ($child->name === $parent->name) { |
||
| 60 | return true; |
||
| 61 | } |
||
| 62 | foreach ($auth->getChildren($child->name) as $grandchild) { |
||
| 63 | if (self::detectLoop($parent, $grandchild)) { |
||
| 64 | return true; |
||
| 65 | } |
||
| 66 | } |
||
| 67 | return false; |
||
| 68 | } |
||
| 70 |