Skip to content

Helpers override compatibility #255

@bsh314

Description

@bsh314

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?

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