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

CurlStrategy   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A sendRequest() 0 2 1
A __construct() 0 2 1
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
}