Completed
Push — master ( 581a9c...240c2a )
by Nikola
02:24
created

PreReleaseIdentifier   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 6 2
1
<?php
2
3
/**
4
 * This file is part of the Version package.
5
 *
6
 * Copyright (c) Nikola Posa <[email protected]>
7
 *
8
 * For full copyright and license information, please refer to the LICENSE file,
9
 * located at the package root folder.
10
 */
11
12
namespace Version\Identifier;
13
14
use Version\Exception\InvalidIdentifierValueException;
15
16
/**
17
 * @author Nikola Posa <[email protected]>
18
 */
19
final class PreReleaseIdentifier extends BaseIdentifier
20
{
21 41
    protected static function validate($value)
22
    {
23 41
        if (!preg_match('/^[0-9A-Za-z\-]+$/', $value)) {
24 1
            throw new InvalidIdentifierValueException(__CLASS__ . ' value must contain only alphanumerics and hyphen');
25
        }
26 40
    }
27
}
28