Passed
Push — master ( 32dd3a...b6a4c4 )
by Caen
03:02 queued 12s
created

XML::escape()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Hyde\Support\Helpers;
6
7
use function htmlspecialchars;
8
9
/**
10
 * @internal This class is currently experimental and may change without notice.
11
 */
12
class XML
13
{
14
    public static function escape(string $string): string
15
    {
16
        return htmlspecialchars($string, ENT_XML1 | ENT_COMPAT, 'UTF-8');
17
    }
18
}
19