Passed
Push — main ( 66f102...e7c7b0 )
by Yevhenii
02:28
created

CurlStrategy::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 0
nc 1
nop 1
dl 0
loc 2
c 1
b 0
f 0
cc 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SteamMarketProviders\ParserManager\Http\Strategy;
6
7
use SteamMarketProviders\ParserManager\Contract\StrategyInterface;
8
use SteamMarketProviders\ParserManager\Http\Options;
9
use SteamMarketProviders\ParserManager\Http\Response;
10
11
class CurlStrategy implements StrategyInterface
12
{
13
    /**
14
     * @param Options|null $options
15
     */
16
    public function __construct(null|Options $options = null)
17
    {
18
    }
19
20
    /**
21
     * @param string $url
22
     * @return Response
23
     */
24
    public function sendRequest(string $url): Response
25
    {
26
        // TODO: Implement sendRequest() method.
27
    }
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return SteamMarketProviders\ParserManager\Http\Response. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
28
}