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

GetTradingFeeRateTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 12
dl 0
loc 21
rs 10
c 2
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGetTradingFeeRateEndpoint() 0 19 2
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\Request\GetTradingFeeRateRequest;
7
use Carpenstar\ByBitAPI\Derivatives\Contract\Account\GetTradingFeeRate\Response\GetTradingFeeRateResponseItem;
8
use PHPUnit\Framework\TestCase;
9
10
class GetTradingFeeRateTest extends TestCase
11
{
12
    public function testGetTradingFeeRateEndpoint()
13
    {
14
        $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

14
        $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...
15
            ->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

15
            ->/** @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...
16
17
        $feeRateData = $bybit->privateEndpoint(GetTradingFeeRate::class, (new GetTradingFeeRateRequest()))->execute();
18
19
        echo "Return code: {$feeRateData->getReturnCode()} \n";
20
        echo "Return message: {$feeRateData->getReturnMessage()} \n";
21
22
        /** @var GetTradingFeeRateResponseItem $feeRate */
23
        foreach (array_slice($feeRateData->getResult()->getFeeRates(), 0, 3) as $feeRate) {
24
            echo "---\n";
25
            echo "Symbol: {$feeRate->getSymbol()} \n";
26
            echo "Taker Fee Rate: {$feeRate->getTakerFeeRate()} \n";
27
            echo "Maker Fee Rate: {$feeRate->getMakerFeeRate()} \n";
28
        }
29
30
        $this->assertTrue(true);
31
    }
32
}