src/Actions/Sync/CatchSuperuserAction.php
<?php namespace Herpaderpaldent\Seat\SeatGroups\Actions\Sync; use Seat\Web\Models\Group; class CatchSuperuserAction{ protected $group; protected $roles; public function __construct() { $this->roles = collect(); } Function `execute` has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. public function execute(Group $group) { $this->group = $group; //Catch superuser permissions foreach ($this->group->roles as $role) { foreach ($role->permissions as $permission) { if ($permission->title === 'superuser') { $this->roles->push($role->id); } } } return $this->roles; }}