wishthis/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoEchoSprintfStandard.xml
2023-09-20 13:52:46 +02:00

25 lines
821 B
XML

<?xml version="1.0"?>
<documentation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd"
title="No Echo Sprintf"
>
<standard>
<![CDATA[
Detects use of `echo [v]sprintf(...);`. Use `[v]printf()` instead.
]]>
</standard>
<code_comparison>
<code title="Valid: using [v]printf() or echo with anything but [v]sprintf().">
<![CDATA[
<em>printf</em>('text %s text', $var);
<em>echo callMe</em>('text %s text', $var);
]]>
</code>
<code title="Invalid: using echo [v]sprintf().">
<![CDATA[
<em>echo sprintf</em>('text %s text', $var);
<em>echo vsprintf</em>('text %s text', [$var]);
]]>
</code>
</code_comparison>
</documentation>