AbstractRequest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 1
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 1 1
1
<?php
2
3
/*
4
 * This file is part of the pexels-library package.
5
 *
6
 * (c) 2019 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Library\Pexels\Request;
13
14
use InvalidArgumentException;
15
use WBW\Library\Pexels\Api\RequestInterface;
16
use WBW\Library\Pexels\Response\AbstractResponse;
17
use WBW\Library\Provider\Request\AbstractRequest as BaseRequest;
18
19
/**
20
 * Abstract request.
21
 *
22
 * @author webeweb <https://github.com/webeweb>
23
 * @package WBW\Library\Pexels\Request
24
 * @abstract
25
 */
26
abstract class AbstractRequest extends BaseRequest implements RequestInterface {
27
28
    /**
29
     * Constructor.
30
     */
31
    public function __construct() {
32
        // NOTHING TO DO
33
    }
34
35
    /**
36
     * Deserialize a response.
37
     *
38
     * @param string $rawResponse The raw response.
39
     * @return AbstractResponse Returns the deserialized response.
40
     */
41
    abstract public function deserializeResponse(string $rawResponse): AbstractResponse;
42
43
    /**
44
     * Serialize this request.
45
     *
46
     * @return array<string,mixed> Returns this serialized request.
47
     * @throws InvalidArgumentException Throws an invalid argument exception if a mandatory parameter is missing.
48
     */
49
    abstract public function serializeRequest(): array;
50
}
51