Skip to content

GitHub.php: Invalid argument supplied for foreach() #68

Open
@michaelharper

Description

@michaelharper

screenshot 2014-07-14 17 43 26

Experiencing Invalid argument supplied for foreach() when I attempt to register with GitHub. Here is the function:

/**
 * Get the primary, verified email address from the Github data.
 *
 * @param  mixed $emails
 * @return mixed
 */
protected function getPrimaryEmail($emails)
{
    foreach ($emails as $email) {
        if (! $email->primary) {
            continue;
        }

        if ($email->verified) {
            return $email->email;
        }

        throw new GithubEmailNotVerifiedException;
    }

    return null;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions