Skip to content

Commit 4bb39b9

Browse files
Adds the \Stringable interface to classes that have __toString() method (#5920)
Co-authored-by: 李铭昕 <715557344@qq.com>
1 parent 027c239 commit 4bb39b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
function str($string = null)
2121
{
2222
if (func_num_args() === 0) {
23-
return new class() {
23+
return new class() implements \Stringable {
2424
public function __call($method, $parameters)
2525
{
2626
return Str::$method(...$parameters);
2727
}
2828

29-
public function __toString()
29+
public function __toString(): string
3030
{
3131
return '';
3232
}

0 commit comments

Comments
 (0)