Issues (87)

src/Builder/RunnableSelect.php (14 issues)

1
<?php
2
3
namespace Kir\MySQL\Builder;
4
5
use Generator;
6
use IteratorAggregate;
7
use Kir\MySQL\Builder\Helpers\DBIgnoreRow;
8
use Kir\MySQL\Tools\AliasReplacer;
9
use Traversable;
10
11
/**
12
 * @extends IteratorAggregate<int, array<string, mixed>>
13
 */
14
interface RunnableSelect extends Select, IteratorAggregate {
15
	/**
16
	 * @return AliasReplacer
17
	 */
18
	public function aliasReplacer(): AliasReplacer;
19
20
	/**
21
	 * @param array<string, mixed> $values
22
	 * @return $this
23
	 */
24
	public function bindValues(array $values);
25
26
	/**
27
	 * @param string $key
28
	 * @param string|int|bool|float|null $value
29
	 * @return $this
30
	 */
31
	public function bindValue(string $key, $value);
32
33
	/**
34
	 * @return $this
35
	 */
36
	public function clearValues(): self;
37
38
	/**
39
	 * @param bool $preserveTypes
40
	 * @return $this
41
	 */
42
	public function setPreserveTypes(bool $preserveTypes = true): self;
43
44
	/**
45
	 * Fetches all rows using PDO::FETCH_NUM
46
	 *
47
	 * @template T of mixed[]
48
	 * @param null|callable(array<string, null|scalar>): (void|DBIgnoreRow|T) $callback
49
	 * @return ($callback is null ? list<array<int, null|scalar>> : array<int, T>)
0 ignored issues
show
Documentation Bug introduced by
The doc comment ($callback at position 1 could not be parsed: Unknown type name '$callback' at position 1 in ($callback.
Loading history...
50
	 */
51
	public function fetchIndexedRows($callback = null): array;
52
53
	/**
54
	 * @template T
55
	 * @param null|callable(array<string, null|scalar>): (void|DBIgnoreRow|T) $callback
56
	 * @return ($callback is null ? array<int, array<string, null|scalar>> : list<T>)
0 ignored issues
show
Documentation Bug introduced by
The doc comment ($callback at position 1 could not be parsed: Unknown type name '$callback' at position 1 in ($callback.
Loading history...
57
	 */
58
	public function fetchRows($callback = null): array;
59
60
	/**
61
	 * @template T
62
	 * @param null|callable(array<string, null|scalar>): (void|DBIgnoreRow|T) $callback
63
	 * @return ($callback is null ? Generator<int, array<string, null|scalar>> : Generator<int, T>)
0 ignored issues
show
Documentation Bug introduced by
The doc comment ($callback at position 1 could not be parsed: Unknown type name '$callback' at position 1 in ($callback.
Loading history...
64
	 */
65
	public function fetchRowsLazy($callback = null);
66
67
	/**
68
	 * @template T of array
69
	 * @param null|callable(array<string, mixed>): (T|void|DBIgnoreRow) $callback
70
	 * @return ($callback is null ? array<string, null|scalar> : T)
0 ignored issues
show
Documentation Bug introduced by
The doc comment ($callback at position 1 could not be parsed: Unknown type name '$callback' at position 1 in ($callback.
Loading history...
71
	 */
72
	public function fetchRow($callback = null): array;
73
74
	/**
75
	 * @template T
76
	 * @template U
77
	 * @param class-string<T> $className
0 ignored issues
show
Documentation Bug introduced by
The doc comment class-string<T> at position 0 could not be parsed: Unknown type name 'class-string' at position 0 in class-string<T>.
Loading history...
78
	 * @param null|callable(T): U $callback
79
	 * @return ($callback is null ? array<int, T> : array<int, U>)
0 ignored issues
show
Documentation Bug introduced by
The doc comment ($callback at position 1 could not be parsed: Unknown type name '$callback' at position 1 in ($callback.
Loading history...
80
	 */
81
	public function fetchObjects(string $className = 'stdClass', $callback = null): array;
82
83
	/**
84
	 * @template T
85
	 * @template U
86
	 * @param class-string<T> $className
0 ignored issues
show
Documentation Bug introduced by
The doc comment class-string<T> at position 0 could not be parsed: Unknown type name 'class-string' at position 0 in class-string<T>.
Loading history...
87
	 * @param null|callable(T): U $callback
88
	 * @return ($callback is null ? Generator<int, T> : Generator<int, U>)
0 ignored issues
show
Documentation Bug introduced by
The doc comment ($callback at position 1 could not be parsed: Unknown type name '$callback' at position 1 in ($callback.
Loading history...
89
	 */
90
	public function fetchObjectsLazy($className = null, $callback = null);
91
92
	/**
93
	 * @template T
94
	 * @template U
95
	 * @param class-string<T> $className
0 ignored issues
show
Documentation Bug introduced by
The doc comment class-string<T> at position 0 could not be parsed: Unknown type name 'class-string' at position 0 in class-string<T>.
Loading history...
96
	 * @param null|callable(T): U $callback
97
	 * @return ($callback is null ? T : U)
0 ignored issues
show
Documentation Bug introduced by
The doc comment ($callback at position 1 could not be parsed: Unknown type name '$callback' at position 1 in ($callback.
Loading history...
98
	 */
99
	public function fetchObject($className = null, $callback = null);
100
101
	/**
102
	 * @param bool $treatValueAsArray
103
	 * @return array<array-key, mixed>
0 ignored issues
show
Documentation Bug introduced by
The doc comment array<array-key, mixed> at position 2 could not be parsed: Unknown type name 'array-key' at position 2 in array<array-key, mixed>.
Loading history...
104
	 */
105
	public function fetchKeyValue($treatValueAsArray = false): array;
106
107
	/**
108
	 * @param string[] $fields
109
	 * @return array<string, array<int, mixed>>
110
	 */
111
	public function fetchGroups(array $fields): array;
112
113
	/**
114
	 * @template T
115
	 * @param null|callable(null|scalar): T $fn
116
	 * @return ($fn is null ? array<int, null|scalar> : array<int, T>)
0 ignored issues
show
Documentation Bug introduced by
The doc comment ($fn at position 1 could not be parsed: Unknown type name '$fn' at position 1 in ($fn.
Loading history...
117
	 */
118
	public function fetchArray(?callable $fn = null): array;
119
120
	/**
121
	 * @template TDefault
122
	 * @template TCastFn
123
	 * @param TDefault $default
0 ignored issues
show
The type Kir\MySQL\Builder\TDefault was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
124
	 * @param null|callable(null|bool|string|int|float): TCastFn $fn
125
	 * @return ($fn is null ? null|scalar|TDefault : TCastFn)
0 ignored issues
show
Documentation Bug introduced by
The doc comment ($fn at position 1 could not be parsed: Unknown type name '$fn' at position 1 in ($fn.
Loading history...
126
	 */
127
	public function fetchValue($default = null, ?callable $fn = null);
128
129
	/**
130
	 * @return int
131
	 */
132
	public function getFoundRows(): int;
133
134
	/**
135
	 * @return Traversable<int, array<string, mixed>>
136
	 */
137
	public function getIterator(): Traversable;
138
}
139