SReady::ready()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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