mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-15 16:07:55 +03:00
Mark toString() method as deprecated, scheduled for removal in 4.0.0
This commit is contained in:
@@ -590,6 +590,14 @@ class Uuid implements UuidInterface
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @deprecated In ramsey/uuid 4.0.0, this method will be replaced with the
|
||||
* __toString() magic method, which is already available on this class.
|
||||
* The new recommendation is to cast Uuid objects to string, rather than
|
||||
* calling `toString()`.
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return $this->codec->encode($this);
|
||||
|
||||
@@ -268,6 +268,10 @@ interface UuidInterface extends JsonSerializable, Serializable
|
||||
/**
|
||||
* Converts this UUID into a string representation.
|
||||
*
|
||||
* @deprecated In ramsey/uuid 4.0.0, this method will be replaced with the
|
||||
* __toString() magic method, which is currently available in the
|
||||
* Uuid concrete class. The new recommendation is to cast Uuid objects
|
||||
* to string, rather than calling `toString()`.
|
||||
* @return string
|
||||
*/
|
||||
public function toString();
|
||||
|
||||
Reference in New Issue
Block a user