Find a Rector rule

Find the best Rector rule to solve your problem. Searching through 1085 rules.

Found 1 rule. That's the one: Clear

symfony/json-streamer 1 match
NarrowJsonStreamerAutowiringTypeRector symfony/json-streamer >=8.2

Change deprecated autowired JsonStreamWriter and JsonStreamReader to their interfaces, if only write() or read() is called on them

-use Symfony\Component\JsonStreamer\JsonStreamWriter;
+use Symfony\Component\JsonStreamer\StreamWriterInterface;
 use Symfony\Component\TypeInfo\Type;

 final class SomeService
 {
     public function __construct(
-        private JsonStreamWriter $jsonStreamWriter
+        private StreamWriterInterface $jsonStreamWriter
     ) {
     }

     public function run(array $data): string
     {
         return (string) $this->jsonStreamWriter->write($data, Type::array());
     }
 }