Failed Conditions
Push — perf-tests ( 50942d...2fc93e )
by Adrien
14:53
created

ODS   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 1
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A escape() 0 4 1
A unescape() 0 4 1
1
<?php
2
3
namespace Box\Spout\Common\Escaper;
4
5
use Box\Spout\Common\Singleton;
6
7
/**
8
 * Class ODS
9
 * Provides functions to escape and unescape data for ODS files
10
 *
11
 * @package Box\Spout\Common\Escaper
12
 */
13
class ODS implements EscaperInterface
14
{
15
    use Singleton;
16
17
    /**
18
     * Escapes the given string to make it compatible with XLSX
19
     *
20
     * @param string $string The string to escape
21
     * @return string The escaped string
22
     */
23
    public function escape($string)
24
    {
25
        return htmlspecialchars($string, ENT_QUOTES);
26
    }
27
28
    /**
1 ignored issue
show
introduced by
Instead of declaring the constructor as final, maybe you should declare the entire class as final.
Loading history...
29
     * Unescapes the given string to make it compatible with XLSX
30
     *
31
     * @param string $string The string to unescape
32
     * @return string The unescaped string
33
     */
34
    public function unescape($string)
35
    {
36
        return htmlspecialchars_decode($string, ENT_QUOTES);
37
    }
38
}
39