Skip to content

Commit

Permalink
Adds the \Stringable interface to classes that have __toString()
Browse files Browse the repository at this point in the history
…method (#5920)


Co-authored-by: 李铭昕 <[email protected]>
  • Loading branch information
huangdijia and limingxinleo committed Jul 10, 2023
1 parent 70a31fb commit 8bc720b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Jsonable.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
*/
namespace Hyperf\Contract;

interface Jsonable
use Stringable;

interface Jsonable extends Stringable
{
public function __toString(): string;
}
4 changes: 3 additions & 1 deletion src/Xmlable.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
*/
namespace Hyperf\Contract;

interface Xmlable
use Stringable;

interface Xmlable extends Stringable
{
public function __toString(): string;
}

0 comments on commit 8bc720b

Please sign in to comment.