SReady   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 3
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A ready() 0 3 1
1
<?php
2
/**
3
 * Service ready sta
4
 * User: moyo
5
 * Date: 2018/7/2
6
 * Time: 10:44 AM
7
 */
8
9
namespace Carno\Consul\Chips;
10
11
use Carno\Promise\Promise;
12
use Carno\Promise\Promised;
13
14
trait SReady
15
{
16
    /**
17
     * @var Promised
18
     */
19
    private $ready = null;
20
21
    /**
22
     * @return Promised
23
     */
24
    public function ready() : Promised
25
    {
26
        return $this->ready ?? $this->ready = Promise::deferred();
27
    }
28
}
29