SafeNameEncoder   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 14
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A isASafeString() 0 7 2
1
<?php
2
/**
3
 *  This file is part of the Simple S3 package.
4
 *
5
 * (c) Mauro Cassani<https://github.com/mauretto78>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 */
11
12
namespace Matecat\SimpleS3\Components\Encoders;
13
14
abstract class SafeNameEncoder implements SafeNameEncoderInterface
15
{
16
    /**
17
     * @param string $string
18
     *
19
     * @return bool
20
     */
21 6
    protected function isASafeString($string)
22
    {
23 6
        if (!preg_match('/^[a-zA-Z 0-9\/\!\-\_\.\'\*\(\)]*$/', $string)) {
24 5
            return false;
25
        }
26
27 6
        return true;
28
    }
29
}
30