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

Correct casing for summonername #56

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Krayt1x
Copy link

@Krayt1x Krayt1x commented Jan 2, 2016

This is mainly me learning how to do pull requests, but i wanted to get the correct casing on a username.

added the ! to line 195 as recommended by kevinohashi

Added "getSummonerName" this returns the correctly formatted name from a lowercase name 
Example "UseRName" from "username"
Removed my API key
@kevinohashi
Copy link
Owner

I'm confused what this is trying to do or add to the library? It looks like you created a function to get a summoner by name passing in a name?

@Krayt1x
Copy link
Author

Krayt1x commented Jan 2, 2016

yeah forget what im trying to do there, i see its already implements in the getSummoner call.

what it did do was correct the casing on a summoner name

example being you would put in username and get back USerNaMe or what ever casing they have.

@kevinohashi
Copy link
Owner

Ah I see. That functionality exists in

    //Returns summoner info given summoner id.
    public function getSummoner($id,$option=null){
        $call = 'summoner/' . $id;
        switch ($option) {
            case 'masteries':
                $call .= '/masteries';
                break;
            case 'runes':
                $call .= '/runes';
                break;
            case 'name':
                $call .= '/name';
                break;
            default:
                //do nothing
                break;
        }
        //add API URL to the call
        $call = self::API_URL_1_4 . $call;
        return $this->request($call);
    }

if you pass in optional parameter 'name'

if you pass summoner id 19008487 with name optional param, you get back:

{"19008487": "PewPewLasers"}

@Krayt1x
Copy link
Author

Krayt1x commented Jan 2, 2016

hey, i made the other post before i saw this but i seem to be getting the same string vs array issue again with this query as well.

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

Successfully merging this pull request may close these issues.

2 participants