Completed
Push — master ( 450f6c...ad56b7 )
by Stefan
05:07
created

InvalidArgument::payloadMustBeArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Gemz\HttpClient\Exceptions;
4
5
use InvalidArgumentException;
6
7
final class InvalidArgument extends InvalidArgumentException
8
{
9
    /**
10
     * @return InvalidArgument
11
     */
12
    public static function payloadMustBeArray(): InvalidArgument
13
    {
14
        return new static(
15
            "Payload must be an array when content-type is application/json, " .
16
            "multipart/form-data or application/x-www-form-urlencoded");
17
    }
18
19
    /**
20
     * @param string $bodyFormat
21
     *
22
     * @return InvalidArgument
23
     */
24
    public static function payloadAndBodyFormatNotCompatible(string $bodyFormat): self
0 ignored issues
show
Unused Code introduced by
The parameter $bodyFormat is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
25
    {
26
        return new static(
27
            "The body format and the payload are not compatiblePayload must be an array when content-type is application/json, " .
28
            "multipart/form-data or application/x-www-form-urlencoded");
29
    }
30
}
31