Completed
Push — master ( c80620...0cd8d9 )
by Martijn
03:25
created

Context::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 3
dl 0
loc 7
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
introduced by
The trait Vanderlee\Comprehend\Cor...ext\SpacingContextTrait requires some properties which are not provided by Vanderlee\Comprehend\Core\Context: $match, $length
Loading history...
20
21
    public function __construct($skipper = null, $case_sensitive = true, $preference = Prefer::FIRST)
22
    {
23
        self::assertPreference($preference);
24
25
        $this->pushSpacer($skipper);
26
        $this->pushCaseSensitivity($case_sensitive);
27
        $this->pushPreference($preference);
28
    }
29
30
}
31