Test Failed
Pull Request — master (#20)
by Vladislav
02:26
created

GetTradingFeeRateTest::testGetTradingFeeRateResponseHandlerBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
namespace Carpenstar\ByBitAPI\Derivatives\Contract\Account\GetTradingFeeRate\Tests;
3
4
use Carpenstar\ByBitAPI\BybitAPI;
5
use Carpenstar\ByBitAPI\Derivatives\Contract\Account\GetTradingFeeRate\GetTradingFeeRate;
6
use Carpenstar\ByBitAPI\Derivatives\Contract\Account\GetTradingFeeRate\Interfaces\IGetTradingFeeRateResponseInterface;
7
use Carpenstar\ByBitAPI\Derivatives\Contract\Account\GetTradingFeeRate\Request\GetTradingFeeRateRequest;
8
use Carpenstar\ByBitAPI\Derivatives\Contract\Account\GetTradingFeeRate\Response\GetTradingFeeRateResponse;
9
use Carpenstar\ByBitAPI\Derivatives\Contract\Account\GetTradingFeeRate\Response\GetTradingFeeRateResponseItem;
10
use PHPUnit\Framework\TestCase;
11
12
class GetTradingFeeRateTest extends TestCase
13
{
14
    public function testGetTradingFeeRateEndpoint()
15
    {
16
        $bybit = (new BybitAPI())
0 ignored issues
show
Bug introduced by
The call to Carpenstar\ByBitAPI\BybitAPI::__construct() has too few arguments starting with host. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

16
        $bybit = (/** @scrutinizer ignore-call */ new BybitAPI())

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
17
            ->setCredentials('https://api-testnet.bybit.com', 'fL02oi5qo8i2jDxlum', 'Ne1EE35XTprIWrId9vGEAc1ZYJTmodA4qFzZ');
0 ignored issues
show
Bug introduced by
The method setCredentials() does not exist on Carpenstar\ByBitAPI\BybitAPI. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

17
            ->/** @scrutinizer ignore-call */ setCredentials('https://api-testnet.bybit.com', 'fL02oi5qo8i2jDxlum', 'Ne1EE35XTprIWrId9vGEAc1ZYJTmodA4qFzZ');

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
18
19
        $feeRateData = $bybit->privateEndpoint(GetTradingFeeRate::class, (new GetTradingFeeRateRequest()))->execute();
20
21
        echo "Return code: {$feeRateData->getReturnCode()} \n";
22
        echo "Return message: {$feeRateData->getReturnMessage()} \n";
23
24
        /** @var GetTradingFeeRateResponseItem $feeRate */
25
        foreach (array_slice($feeRateData->getResult()->getFeeRates(), 0, 3) as $feeRate) {
26
            echo "---\n";
27
            echo "Symbol: {$feeRate->getSymbol()} \n";
28
            echo "Taker Fee Rate: {$feeRate->getTakerFeeRate()} \n";
29
            echo "Maker Fee Rate: {$feeRate->getMakerFeeRate()} \n";
30
        }
31
32
       /**
33
        * Return code: 0
34
       Return message: OK
35
       ---
36
       Symbol: ORCAUSDT
37
       Taker Fee Rate: 0.00055
38
       Maker Fee Rate: 0.0002
39
       ---
40
       Symbol: BBUSDT
41
       Taker Fee Rate: 0.00055
42
       Maker Fee Rate: 0.0002
43
       ---
44
       Symbol: INJUSDT
45
       Taker Fee Rate: 0.00055
46
       Maker Fee Rate: 0.0002
47
      */
48
    }
49
}