Test Failed
Push — master ( a6b51e...5fffdb )
by Gabriel
08:05
created

ClientHasSecretTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
dl 0
loc 27
rs 10
c 0
b 0
f 0
ccs 5
cts 7
cp 0.7143
wmc 3
lcom 1
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A validateSecret() 0 4 1
A setSecret() 0 4 1
A getSecret() 0 4 1
1
<?php
2
3
namespace ByTIC\Hello\Models\Clients\Traits;
4
5
/**
6
 * Trait ClientHasSecretTrait
7
 * @package ByTIC\Hello\Models\Clients\Traits
8
 *
9
 * @property string $secret
10
 */
11
trait ClientHasSecretTrait
12
{
13
    /**
14
     * @param string $secret
15
     * @return bool
16
     */
17
    public function validateSecret(string $secret): bool
18
    {
19
        return $this->secret === $secret;
20
    }
21
22
    /**
23
     * @param string $secret
24
     */
25 19
    public function setSecret(string $secret)
26
    {
27 19
        $this->secret = $secret;
28 19
    }
29
30
    /**
31
     * @return string
32
     */
33 4
    public function getSecret(): string
34
    {
35 4
        return $this->secret;
36
    }
37
}
38