Completed
Push — master ( a0580c...57df1c )
by Tomasz
01:44
created

SourceSpec::let()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace spec\Aggrego\Domain\ValueObject;
4
5
use PhpSpec\ObjectBehavior;
6
use Aggrego\Domain\ValueObject\Name;
0 ignored issues
show
Bug introduced by
The type Aggrego\Domain\ValueObject\Name was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Aggrego\Domain\ValueObject\Source;
0 ignored issues
show
Bug introduced by
The type Aggrego\Domain\ValueObject\Source was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Aggrego\Domain\ValueObject\Version;
0 ignored issues
show
Bug introduced by
The type Aggrego\Domain\ValueObject\Version was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
10
class SourceSpec extends ObjectBehavior
11
{
12
    function let(Name $name, Version $version)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
13
    {
14
        $this->beConstructedWith($name, $version);
15
    }
16
17
    function it_is_initializable()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
18
    {
19
        $this->shouldHaveType(Source::class);
20
    }
21
22
    function it_should_have_name()
23
    {
24
        $this->getName()->shouldBeAnInstanceOf(Name::class);
0 ignored issues
show
Bug introduced by
The method getName() does not exist on spec\Aggrego\Domain\ValueObject\SourceSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

24
        $this->/** @scrutinizer ignore-call */ 
25
               getName()->shouldBeAnInstanceOf(Name::class);
Loading history...
25
    }
26
27
    function it_should_have_version()
28
    {
29
        $this->getVersion()->shouldBeAnInstanceOf(Version::class);
0 ignored issues
show
Bug introduced by
The method getVersion() does not exist on spec\Aggrego\Domain\ValueObject\SourceSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

29
        $this->/** @scrutinizer ignore-call */ 
30
               getVersion()->shouldBeAnInstanceOf(Version::class);
Loading history...
30
    }
31
32
    function is_should_check_equal_instances(Source $source)
33
    {
34
        $this->equal($source)->shouldBeBool();
0 ignored issues
show
Bug introduced by
The method equal() does not exist on spec\Aggrego\Domain\ValueObject\SourceSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

34
        $this->/** @scrutinizer ignore-call */ 
35
               equal($source)->shouldBeBool();
Loading history...
35
    }
36
37
    function it_should_convert_to_string()
38
    {
39
        $this->beConstructedWith(new Name('test'), new Version('1.0.0'));
40
        $subject = $this->__toString();
0 ignored issues
show
Bug introduced by
The method __toString() does not exist on spec\Aggrego\Domain\ValueObject\SourceSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

40
        /** @scrutinizer ignore-call */ 
41
        $subject = $this->__toString();
Loading history...
41
        $subject->shouldBeString();
42
        $subject->shouldBe('test:1.0.0');
43
    }
44
}
45