Skip to content

Commit b4ca43c

Browse files
rodrigoprimopamprn09bhubbard
authored
WP/AlternativeFunctions: add XML documentation (#2687)
Co-authored-by: pamprn09 <pamprn09@users.noreply.github.com> Co-authored-by: bhubbard <bhubbard@users.noreply.github.com> Co-authored-by: Pamela Ribeiro <contato@pamelanascimento.com>
1 parent ea73437 commit b4ca43c

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0"?>
2+
<documentation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd"
4+
title="Alternative Functions"
5+
>
6+
<standard>
7+
<![CDATA[
8+
Use WordPress functions instead of certain native PHP functions.
9+
10+
These WordPress functions typically improve consistency across different PHP versions, operating systems, and server configurations, and/or provide a more comprehensive or robust version of the PHP native function. Using them can make the code more portable and reliable.
11+
]]>
12+
</standard>
13+
<code_comparison>
14+
<code title="Valid: Using a WordPress alternative function.">
15+
<![CDATA[
16+
$number = <em>wp_rand</em>( 1, 100 );
17+
]]>
18+
</code>
19+
<code title="Invalid: Using a discouraged PHP function.">
20+
<![CDATA[
21+
$number = <em>mt_rand</em>( 1, 100 );
22+
]]>
23+
</code>
24+
</code_comparison>
25+
</documentation>

0 commit comments

Comments
 (0)