-
-
Notifications
You must be signed in to change notification settings - Fork 491
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation for WordPress.PHP.DevelopmentFunctions
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0"?> | ||
<documentation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd" | ||
title="Development Functions" | ||
> | ||
<standard> | ||
<![CDATA[ | ||
Debug code should not normally be used in production. | ||
Typically, this rule verifies if function calls to the PHP native `error_log()`, `var_dump()`, `var_export()`, `print_r()`, `trigger_error()`, `set_error_handler()`, `debug_backtrace`, `debug_print_backtrace` and `wp_debug_backtrace_summary()` functions are present in the code. | ||
]]> | ||
</standard> | ||
<code_comparison> | ||
<code title="Valid: (Not) using var_dump()."> | ||
<![CDATA[ | ||
// var_dump() should not be used. | ||
]]> | ||
</code> | ||
<code title="Invalid: Calling the PHP native `var_dump()` function."> | ||
<![CDATA[ | ||
var_dump( $bar ); | ||
]]> | ||
</code> | ||
</code_comparison> | ||
<standard> | ||
<![CDATA[ | ||
Please refrain from using functions that can lead to full path disclosure. | ||
Typically, this rule verifies if function calls to the PHP native `error_reporting()` and `phpinfo()` functions are present in the code. | ||
]]> | ||
</standard> | ||
<code_comparison> | ||
<code title="Valid: (Not) using `phpinfo()`."> | ||
<![CDATA[ | ||
// php_info() should not be used. | ||
]]> | ||
</code> | ||
<code title="Invalid: Calling the PHP native `phpinfo()` function."> | ||
<![CDATA[ | ||
phpinfo(); | ||
]]> | ||
</code> | ||
</code_comparison> | ||
</documentation> |