SanitizeInput   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A trimDoubleQuotes() 0 6 3
1
<?php
2
3
namespace Suitmedia\LighthouseAudit\Concerns;
4
5
trait SanitizeInput
6
{
7
    /**
8
     * Trim double quotes from input options.
9
     *
10
     * @param string $text
11
     *
12
     * @return string
13
     */
14
    protected function trimDoubleQuotes(string $text) :string
15
    {
16
        return ((strpos($text, '"') === 0) && ($text[strlen($text) - 1] === '"')) ?
17
            substr($text, 1, -1) :
18
            $text;
19
    }
20
}
21