ClientHasSecretTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 71.43%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
eloc 4
c 1
b 0
f 1
dl 0
loc 25
rs 10
ccs 5
cts 7
cp 0.7143

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getSecret() 0 3 1
A validateSecret() 0 3 1
A setSecret() 0 3 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 20
    public function setSecret(string $secret)
26
    {
27 20
        $this->secret = $secret;
28 20
    }
29
30
    /**
31
     * @return string
32
     */
33 5
    public function getSecret(): string
34
    {
35 5
        return $this->secret;
36
    }
37
}
38