Passed
Push — master ( bdfaa2...ebdd6d )
by Vladislav
51s queued 13s
created

OverrideExecuteTrait::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 2
1
<?php
2
namespace Carpenstar\ByBitAPI\Core\Overrides\Spot;
3
4
use Carpenstar\ByBitAPI\Core\Builders\ResponseHandlerBuilder;
5
use Carpenstar\ByBitAPI\Core\Interfaces\ICurlResponseDtoInterface;
6
7
trait OverrideExecuteTrait
8
{
9
    /**
10
     * @param int $mode
11
     * @param string|null $jsonData
12
     * @return ICurlResponseDtoInterface
13
     * @throws \Exception
14
     */
15
    public function execute(int $mode, string $jsonData = null): ICurlResponseDtoInterface
16
    {
17
        return ResponseHandlerBuilder::make(
18
            $jsonData,
0 ignored issues
show
Bug introduced by
It seems like $jsonData can also be of type null; however, parameter $data of Carpenstar\ByBitAPI\Core...eHandlerBuilder::make() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

18
            /** @scrutinizer ignore-type */ $jsonData,
Loading history...
19
            $this->getResponseHandlerClassname(),
0 ignored issues
show
Bug introduced by
It seems like getResponseHandlerClassname() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

19
            $this->/** @scrutinizer ignore-call */ 
20
                   getResponseHandlerClassname(),
Loading history...
20
            $this->getResponseClassname(),
0 ignored issues
show
Bug introduced by
It seems like getResponseClassname() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

20
            $this->/** @scrutinizer ignore-call */ 
21
                   getResponseClassname(),
Loading history...
21
            $mode
22
        );
23
    }
24
}