
Rule no_useless_printf
¶
There must be no printf
calls with only the first argument.
Warning¶
Using this rule is risky¶
Risky when the printf
function is overridden.
Examples¶
Example #1¶
--- Original
+++ New
<?php
-printf('bar');
+print 'bar';
References¶
Fixer class: PhpCsFixer\Fixer\FunctionNotation\NoUselessPrintfFixer
Test class: PhpCsFixer\Tests\Fixer\FunctionNotation\NoUselessPrintfFixerTest
The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.