Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FeaturedGames tries to use same structure as CurrentGame though the structure is different #130

Open
aleksandrd opened this issue Jan 9, 2017 · 1 comment

Comments

@aleksandrd
Copy link

There is a problem with participants in FeaturedGames.
According to Riot API FeaturedGames returns Participant object, while CurrentGame uses CurrentGameParticipant. Main difference is that there is no summonerId in the Participant which causes only 1 last participant being returned in the structure when calling $api->featuredGames()->featuredGames().

To fix this:
in CurrentGame.php add check that summonerId is set, otherwise don't use associative array, i.e.:

       foreach ($rawParticipants as $pkey=>$value) {
            $participant = new CurrentGameParticipant($value);

            if (!isset($participant->summonerId)) {
                $participants[] = $participant;
            } else {
                $participants[$participant->summonerId] = $participant;
            }

        }
@dnlbauer
Copy link
Collaborator

dnlbauer commented Jan 9, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants