Completed
Push — master ( 04e24a...c0588a )
by Martijn
03:54 queued 38s
created

Rfc7405   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 17
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 1
1
<?php /** @noinspection PhpUndefinedFieldInspection */
2
3
/**
4
 * RFC 7405 - Case-Sensitive String Support in ABNF
5
 *
6
 * Updates RFC 5234
7
 *
8
 * @see https://tools.ietf.org/html/rfc7405
9
 * @package Vanderlee\Comprehend\Library
10
 */
11
12
namespace Vanderlee\Comprehend\Library;
13
14
require_once 'functions.php';
15
16
use Vanderlee\Comprehend\Parser\Parser;
17
18
/**
19
 * @property-read Parser case_sensitive_string
20
 * @property-read Parser quoted_string
21
 * @property-read Parser case_insensitive_string
22
 */
23
class Rfc7405 extends Rfc5234
24
{
25
    protected static $name = 'Rfc7405';
26
27 1
    public function __construct($overwrites = [])
28
    {
29
        $rules = [
30
            /*
31
             * 2.2 ABNF Definition of ABNF - char-val
32
             */
33 1
            'quoted_string'           => s($this->DQUOTE, star(c(range(0x20, 0x21), range(0x23, 0x7E))), $this->DQUOTE),
0 ignored issues
show
Bug Best Practice introduced by
The property DQUOTE does not exist on Vanderlee\Comprehend\Library\Rfc7405. Since you implemented __get, consider adding a @property annotation.
Loading history...
34 1
            'case_sensitive_string'   => s('%s', $this->quoted_string),
35 1
            'case_insensitive_string' => s(opt('%i'), $this->quoted_string),
36 1
            'char_val'                => c($this->case_insensitive_string, $this->case_sensitive_string),
37
        ];
38
39 1
        parent::__construct(array_merge($rules, $overwrites));
40
    }
41
}