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

Deprecated: Return type of Ramsey\Uuid\Uuid::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): #498

Open
hubPS7 opened this issue Mar 6, 2023 · 5 comments

Comments

@hubPS7
Copy link

hubPS7 commented Mar 6, 2023

Deprecated: Return type of Ramsey\Uuid\Uuid::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange]
attribute should be used to temporarily suppress the notice in /sugar/vendor/ramsey/uuid/src/Uuid.php on line 216

PHP Version - 8.1.13
Sugar - 12.3.0
OS - Mac

@ramsey
Copy link
Owner

ramsey commented Mar 7, 2023

What version of ramsey/uuid do you have installed? Run composer info ramsey/uuid to find out which version is installed in your project.

I'm not familiar with "Sugar." What is that?

@hubPS7
Copy link
Author

hubPS7 commented Mar 7, 2023 via email

@ramsey
Copy link
Owner

ramsey commented Mar 8, 2023

Thanks. It looks like SugarCRM is using an old version of ramsey/uuid. Do you know where I can find their "community" edition so I can see if it's feasible to submit a pull request to them to update the library?

@prys-at
Copy link

prys-at commented Jul 21, 2023

I have the same issue with v4.7.4 using php version 8.2.6

I looked at the old issue #439 which mentioned this being fixed in v3.9.7 - which it was, however I'd rather use the newest version.

3.9.7 Uuid::jsonSerialize function

/**
     * Converts this UUID object to a string when the object is serialized
     * with `json_encode()`
     *
     * @return string
     * @link http://php.net/manual/en/class.jsonserializable.php
     */
    #[ReturnTypeWillChange]
    public function jsonSerialize()
    {
        return $this->toString();
    }

v4.7.4 Uuid::jsonSerialize function, which has been that way since 4.0.0

/**
     * Converts the UUID to a string for JSON serialization
     */
    public function jsonSerialize(): string
    {
        return $this->toString();
    }

@ramsey
Copy link
Owner

ramsey commented Nov 8, 2023

I have the same issue with v4.7.4 using php version 8.2.6

Are you saying that you're seeing the deprecation message when using ramsey/uuid v4.74 on PHP 8.2.6?

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

3 participants