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

Helpers override compatibility #255

Open
bsh314 opened this issue May 9, 2016 · 0 comments
Open

Helpers override compatibility #255

bsh314 opened this issue May 9, 2016 · 0 comments

Comments

@bsh314
Copy link

bsh314 commented May 9, 2016

After installing this package in rappasoft/laravel-boilerplate it causes
Missing argument 1 for gravatar() ErrorException
Becose of that gravatar()_.get(...) is used by in trait named UserAttribute with path app/Models/Access/User/Traits/Attribute/UserAttribute.php that function is already providen by app/helpers.php, so after re-defining it in vendor/pingpong/support/helpers.php.

Currently this problem can be solved by commenting gravatar function on vendor/pingpong/support/helpers.php, but i think it should be not re-defined in this case

rappasoft/helpers definition:

if (! function_exists('gravatar')) {
    /**
     * Access the gravatar helper
     */
    function gravatar()
    {
        return app('gravatar');
    }
}

pingpong/support/helpers definition:

if (!function_exists('gravatar')) {
    /**
     * Gravatar URL from Email address.
     *
     * @param string $email   Email address
     * @param string $size    Size in pixels
     * @param string $default Default image [ 404 | mm | identicon | monsterid | wavatar ]
     * @param string $rating  Max rating [ g | pg | r | x ]
     *
     * @return string
     */
    function gravatar($email, $size = 60, $default = 'mm', $rating = 'g')
    {
        return 'http://www.gravatar.com/avatar/'.md5(strtolower(trim($email)))."?s={$size}&d={$default}&r={$rating}";
    }
}

Other functions defined in helpers may cause same problems in other projects, anyone had this problem?

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

1 participant