Documentation

NoEchoSprintfSniff
in package
implements Sniff

FinalYes

Detects use of `echo [v]sprintf();.

Tags
link
https://www.php.net/manual/en/function.printf.php
link
https://www.php.net/manual/en/function.sprintf.php
link
https://www.php.net/manual/en/function.vprintf.php
link
https://www.php.net/manual/en/function.vsprintf.php
since
1.1.0

Table of Contents

Interfaces

Sniff

Properties

$targetFunctions  : array<string, string>
Functions to look for with their replacements.

Methods

process()  : void
Processes this test, when one of its tokens is encountered.
register()  : array<string|int, int|string>
Returns an array of tokens this test wants to listen for.

Properties

$targetFunctions

Functions to look for with their replacements.

private array<string, string> $targetFunctions = ['sprintf' => 'printf', 'vsprintf' => 'vprintf']
Tags
since
1.1.0

Methods

process()

Processes this test, when one of its tokens is encountered.

public process(File $phpcsFile, int $stackPtr) : void
Parameters
$phpcsFile : File

The file being scanned.

$stackPtr : int

The position of the current token in the stack passed in $tokens.

Tags
since
1.1.0

register()

Returns an array of tokens this test wants to listen for.

public register() : array<string|int, int|string>
Tags
since
1.1.0
Return values
array<string|int, int|string>

        
On this page

Search results