GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

MultichainHelper::isAssetAvailable()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
dl 0
loc 4
rs 10
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
4
namespace be\kunstmaan\multichain;
5
6
7
class MultichainHelper
8
{
9
10
    /** @var MultichainClient */
11
    protected $multichain;
12
13
    public function __construct($multichainClient)
14
    {
15
        $this->multichain = $multichainClient;
16
    }
17
18
    /**
19
     * @param $assetTxId
20
     * @return bool
21
     */
22
    public function isAssetAvailable($assetTxId){
23
        $assetInfo = $this->getAssetInfoFromTxId($assetTxId);
24
        return !is_null($assetInfo["assetref"]);
25
    }
26
27
    /**
28
     * @param $assetTxId
29
     */
30
    public function waitForAssetAvailability($assetTxId){
31
        while (!$this->isAssetAvailable($assetTxId)){
32
            sleep(1);
33
        }
34
    }
35
36
    /**
37
     * @param $assetTxId
38
     * @return mixed
39
     */
40
    public function getAssetInfoFromTxId($assetTxId){
41
        $assetInfo = $this->multichain->listAssets($assetTxId);
42
        return $assetInfo[0];
43
    }
44
45
}