GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 7392c7...89a30b )
by Sebastian
02:06
created

ParserSpec::it_can_parse_valid_front_matter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 5

Duplication

Lines 14
Ratio 100 %
Metric Value
dl 14
loc 14
rs 9.4286
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace spec\Spatie\YamlFrontMatter;
4
5
use PhpSpec\ObjectBehavior;
6
use Spatie\YamlFrontMatter\Document;
7
use Spatie\YamlFrontMatter\Parser;
8
9
class ParserSpec extends ObjectBehavior
10
{
11
    public function it_is_initializable()
12
    {
13
        $this->shouldHaveType(Parser::class);
14
    }
15
16 View Code Duplication
    public function it_can_parse_valid_front_matter()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
    {
18
        $contents = "
19
        ---
20
        foo: bar
21
        ---
22
23
        Lorem ipsum.
24
        ";
25
26
        $this->parse($contents)->shouldHaveType(Document::class);
27
        $this->parse($contents)->shouldHaveFrontMatter(['foo' => 'bar']);
28
        $this->parse($contents)->shouldHaveBodyContaining('Lorem ipsum.');
29
    }
30
31 View Code Duplication
    public function it_falls_back_to_empty_front_matter_with_the_original_as_body()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
32
    {
33
        $contents = "
34
        ---
35
        foo: bar
36
        --
37
38
        Lorem ipsum.
39
        ";
40
41
        $this->parse($contents)->shouldHaveType(Document::class);
42
        $this->parse($contents)->shouldHaveFrontMatter([]);
43
        $this->parse($contents)->shouldHaveBodyContaining('foo: bar');
44
        $this->parse($contents)->shouldHaveBodyContaining('Lorem ipsum.');
45
    }
46
47
    public function getMatchers() : array
48
    {
49
        return [
50
            'haveFrontMatter' => function (Document $subject, $value) {
51
                return $subject->matter() === $value;
52
            },
53
            'haveBodyContaining' => function (Document $subject, $value) {
54
                return str_contains($subject->body(), $value);
55
            },
56
        ];
57
    }
58
}
59