Context::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 3
dl 0
loc 7
ccs 5
cts 5
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Vanderlee\Comprehend\Core;
4
5
use Vanderlee\Comprehend\Core\Context\CaseSensitiveContextTrait;
6
use Vanderlee\Comprehend\Core\Context\PreferContextTrait;
7
use Vanderlee\Comprehend\Core\Context\SpacingContextTrait;
8
use Vanderlee\Comprehend\Directive\Prefer;
9
10
/**
11
 * Maintains the current context of the parser chain.
12
 *
13
 * @author Martijn
14
 */
15
class Context
16
{
17
    use CaseSensitiveContextTrait;
18
    use PreferContextTrait;
19
    use SpacingContextTrait;
0 ignored issues
show
Bug introduced by
The trait Vanderlee\Comprehend\Cor...ext\SpacingContextTrait requires the property $length which is not provided by Vanderlee\Comprehend\Core\Context.
Loading history...
20
21 514
    public function __construct($skipper = null, $caseSensitive = true, $preference = Prefer::FIRST)
22
    {
23 514
        self::assertPreference($preference);
24
25 513
        $this->pushSpacer($skipper);
26 513
        $this->pushCaseSensitivity($caseSensitive);
27 513
        $this->pushPreference($preference);
28 513
    }
29
}
30