Skip to content

Commit 04f23c1

Browse files
committed
add failing test case showing over-eager stringable matching
currently if a class includes a sub-class with the \Stringable interface then it is oncorrectly flagged as being stringable.
1 parent a384ed8 commit 04f23c1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/Fixer/StringableInterfaceFixerTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,5 +300,17 @@ class Foo5 { public function __noString() { return "5"; } }
300300
;
301301
',
302302
];
303+
304+
yield ['<?php
305+
namespace Foo;
306+
use Stringable;
307+
class Bar {
308+
public function foo() {
309+
new class () implements Stringable {
310+
public function __toString() { return ""; }
311+
};
312+
}
313+
}
314+
'];
303315
}
304316
}

0 commit comments

Comments
 (0)