corcel / acf

Advanced Custom Fields (ACF) plugin for Corcel
126 stars 98 forks source link

Image __toString not correctly implemented #65

Open cjke opened 6 years ago

cjke commented 6 years ago

Image extends BasicField, and provides some abstract base methods - __toString causes an issue with Image in particular as it invokes ->get() as get() for Image returns an Image instance.

__toString must always return a string.

Happy to shoot through a PR. Simplest solution would probably just to overwrite the abstract method __toString in image with something like:

    /**
     * @return string
     */
    public function __toString()
    {
        return $this->url;
    }

This was covered in #60 but it was closed because it wasn't explained in detail