Completed
Push — master ( 50437b...6d2b5a )
by Adam
02:31
created

Mixin   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 24
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1
ccs 4
cts 4
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
toString() 0 1 ?
A toVOString() 0 4 1
A fromVOString() 0 4 1
1
<?php
2
3
namespace BestServedCold\PhalueObjects\VOString;
4
5
use BestServedCold\PhalueObjects\VOString;
6
7
/**
8
 * Class StringableTrait
9
 *
10
 * @package BestServedCold\PhalueObjects\VOString
11
 */
12
trait Mixin
13
{
14
    /**
15
     * @return string
16
     */
17
    public abstract function toString();
18
19
    /**
20
     * @return VOString
21
     */
22 3
    public function toVOString()
23
    {
24 3
        return VOString::fromString($this->toString());
25
    }
26
27
    /**
28
     * @param  VOString $voString
29
     * @return static
30
     */
31 1
    public static function fromVOString(VOString $voString)
32
    {
33 1
        return static::fromString($voString->getValue());
0 ignored issues
show
Bug introduced by
The method fromString() does not exist on BestServedCold\PhalueObjects\VOString\Mixin. Did you maybe mean fromVOString()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
34
    }
35
}
36