private function matchRole($input, array $roles)
    {
        foreach ($roles as $role) {
            if (strpos($role, strtolower($input)) === 0) {
                return $role;
            }
        }

        throw new InvalidArgumentException('Invalid role: ' . $input);
    }
private function matchRole($input, array $roles)
    {
        foreach ($roles as $role) {
            if (strpos($role, strtolower($input)) === 0) {
                return $role;
            }
        }

        throw new InvalidArgumentException('Invalid role: ' . $input);
    }
private function matchRole ( $ input , array $ roles ) { foreach ( $ roles as $ role ) { if ( strpos ( $ role , strtolower ( $ input ) ) === 0 ) { return $ role ; } } throw new InvalidArgumentException ( 'Invalid role: ' . $ input ) ; }
Complete a role name based on an array of allowed roles.

@param string   $input
@param string[] $roles

@return string
Complete a role name based on an array of allowed roles .