Skip to content

Image __toString not correctly implemented #65

@cjke

Description

@cjke

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

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