Issues (48)

src/Bindings/StringBindingInterface.php (5 issues)

1
<?php
2
3
namespace GeekLab\GLPDO2\Bindings;
4
5
use PDO;
6
use Exception;
7
use JsonException;
8
9
interface StringBindingInterface
10
{
11
    /**
12
     * Bind an object or JSON string to a string.
13
     *
14
     * @param mixed $value
15
     * @param bool  $null
16
     *
17
     * @return array{string, int}
0 ignored issues
show
Documentation Bug introduced by
The doc comment array{string, int} at position 2 could not be parsed: Expected ':' at position 2, but found 'string'.
Loading history...
18
     * @throws JsonException
19
     */
20
    public function bJSON(mixed $value, bool $null = false): array;
21
22
    /**
23
     * Create and bind string for LIKE() statements.
24
     *
25
     * @param string $value
26
     * @param bool   $ends   Ends with?
27
     * @param bool   $starts Starts with?
28
     *
29
     * @return array{string}
0 ignored issues
show
Documentation Bug introduced by
The doc comment array{string} at position 2 could not be parsed: Expected ':' at position 2, but found 'string'.
Loading history...
30
     */
31
    public function bLike(string $value, bool $ends = false, bool $starts = false): array;
32
33
    /**
34
     * Bind a string value.
35
     *
36
     * @param float | bool | int | string | null $value
37
     * @param bool                               $null
38
     * @param int                                $type
39
     *
40
     * @return array{string, int}
0 ignored issues
show
Documentation Bug introduced by
The doc comment array{string, int} at position 2 could not be parsed: Expected ':' at position 2, but found 'string'.
Loading history...
41
     * @throws Exception
42
     */
43
    public function bStr(
44
        float | bool | int | string | null $value,
45
        bool $null = false,
46
        int $type = PDO::PARAM_STR
47
    ): array;
48
49
    /**
50
     * Convert an array into a string and bind it.
51
     * Great for IN() statements.
52
     *
53
     * @param array{} | array{mixed}      $values
0 ignored issues
show
Documentation Bug introduced by
The doc comment array{} | array{mixed} at position 6 could not be parsed: Expected ':' at position 6, but found 'mixed'.
Loading history...
54
     * @param float | bool | int | string $default
55
     *
56
     * @return array{float | bool | int | string}
0 ignored issues
show
Documentation Bug introduced by
The doc comment array{float | bool | int | string} at position 2 could not be parsed: Expected ':' at position 2, but found 'float'.
Loading history...
57
     */
58
    public function bStrArr(array $values, float | bool | int | string $default = ''): array;
59
}
60