| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public static function handle(ModelEvent $event) |
||
| 26 | { |
||
| 27 | /** @var Token $token */ |
||
| 28 | $token = $event->sender; |
||
| 29 | |||
| 30 | // Ignore if already set |
||
| 31 | if ($token->isRelationPopulated('environments') === true) { |
||
| 32 | return; |
||
| 33 | } |
||
| 34 | |||
| 35 | $token->setEnvironments((array_unique(self::getEnvironments($token)))); |
||
| 36 | $token->autoSaveEnvironments = true; |
||
| 37 | } |
||
| 38 | |||
| 75 |