uuid icon indicating copy to clipboard operation
uuid copied to clipboard

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

Open hubPS7 opened this issue 2 years ago • 5 comments

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

hubPS7 avatar Mar 06 '23 19:03 hubPS7

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?

ramsey avatar Mar 07 '23 04:03 ramsey

Hi,

Ramsey/uuid version is 3.9 and Sugar is nothing but CRM(SugarCRM).

Regards, Pankaj

On Tue 7 Mar 2023 at 04:07, Ben Ramsey @.***> wrote:

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?

— Reply to this email directly, view it on GitHub https://github.com/ramsey/uuid/issues/498#issuecomment-1457493070, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHNH2TQVR4EN2EZL6PZ3E63W22YA3ANCNFSM6AAAAAAVRR6P64 . You are receiving this because you authored the thread.Message ID: @.***>

--

ThanksPankaj Sapkal

hubPS7 avatar Mar 07 '23 07:03 hubPS7

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?

ramsey avatar Mar 08 '23 04:03 ramsey

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

I looked at the old issue https://github.com/ramsey/uuid/issues/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();
    }

prys-at avatar Jul 21 '23 05:07 prys-at

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?

ramsey avatar Nov 08 '23 03:11 ramsey