Passed
Pull Request — master (#37)
by
unknown
08:26
created

updateNameIDValidation()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 7
rs 10
1
<?php
2
3
namespace SilverStripe\SAML\Extensions;
4
5
use SilverStripe\Core\Extension;
6
7
/**
8
 * Class GUIDNameIDValidationExtension
9
 * 
10
 * Validates a NameID in GUID format.
11
 */
12
class GUIDNameIDValidationExtension extends Extension
13
{
14
    public function updateNameIDValidation(string $nameID, string $nameIDFormat): bool
0 ignored issues
show
Unused Code introduced by
The parameter $nameIDFormat is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

14
    public function updateNameIDValidation(string $nameID, /** @scrutinizer ignore-unused */ string $nameIDFormat): bool

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
15
    {
16
        if (preg_match('/^[A-F0-9]{8}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{12}?$/i', $nameID)) {
17
            return true;
18
        }
19
20
        return false;
21
    }
22
}
23