Skip to content

Commit c7dc115

Browse files
committed
corrections for PHP 8.4
1 parent 605cd0c commit c7dc115

File tree

3 files changed

+116
-3
lines changed

3 files changed

+116
-3
lines changed

src/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ public function setQueryLogger(callable $queryLogger) : void
622622
*
623623
* @return logEntry
624624
*/
625-
protected function newLogEntry(string $statement = null) : array
625+
protected function newLogEntry(?string $statement = null) : array
626626
{
627627
return [
628628
'start' => microtime(true),

src/LoggedStatement.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,25 @@ protected function __construct(
2929
$this->logEntry['statement'] = $this->queryString;
3030
}
3131

32-
public function execute(array $inputParameters = null) : bool
32+
/**
33+
* @param array|null $inputParameters
34+
*
35+
* @return bool
36+
*/
37+
public function execute(?array $inputParameters = null) : bool
3338
{
3439
$result = parent::execute($inputParameters);
3540
$this->log($inputParameters);
3641
return $result;
3742
}
3843

44+
/**
45+
* @param string|int $parameter
46+
* @param mixed $value
47+
* @param int $dataType
48+
*
49+
* @return bool
50+
*/
3951
public function bindValue(
4052
string|int $parameter,
4153
mixed $value,
@@ -52,6 +64,11 @@ public function bindValue(
5264
return $result;
5365
}
5466

67+
/**
68+
* @param array|null $inputParameters
69+
*
70+
* @return void
71+
*/
5572
private function log(?array $inputParameters) : void
5673
{
5774
if ($inputParameters !== null) {

src/PersistentLoggedStatement.php

Lines changed: 97 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,38 @@ static public function new(
5151

5252
/* Attributes */
5353

54+
/**
55+
* @param int $attribute
56+
* @param mixed $value
57+
*
58+
* @return bool
59+
*/
5460
public function setAttribute(int $attribute, mixed $value) : bool
5561
{
5662
return $this->parent->setAttribute($attribute, $value);
5763
}
5864

65+
/**
66+
* @param int $attribute
67+
*
68+
* @return mixed
69+
*/
5970
public function getAttribute(int $attribute) : mixed
6071
{
6172
return $this->parent->getAttribute($attribute);
6273
}
6374

6475
/* Binding */
6576

77+
/**
78+
* @param mixed $column
79+
* @param mixed $param
80+
* @param int $type
81+
* @param int $maxlen
82+
* @param mixed|null $driverdata
83+
*
84+
* @return bool
85+
*/
6686
public function bindColumn(
6787
mixed $column,
6888
mixed &$param,
@@ -76,6 +96,15 @@ public function bindColumn(
7696
);
7797
}
7898

99+
/**
100+
* @param string|int $parameter
101+
* @param mixed $variable
102+
* @param int $data_type
103+
* @param int $length
104+
* @param mixed|null $driver_options
105+
*
106+
* @return bool
107+
*/
79108
public function bindParam(
80109
string|int $parameter,
81110
mixed &$variable,
@@ -93,6 +122,13 @@ public function bindParam(
93122
);
94123
}
95124

125+
/**
126+
* @param string|int $parameter
127+
* @param mixed $value
128+
* @param int $dataType
129+
*
130+
* @return bool
131+
*/
96132
public function bindValue(
97133
string|int $parameter,
98134
mixed $value,
@@ -110,7 +146,12 @@ public function bindValue(
110146

111147
/* Execution */
112148

113-
public function execute(array $inputParameters = null) : bool
149+
/**
150+
* @param array|null $inputParameters
151+
*
152+
* @return bool
153+
*/
154+
public function execute(?array $inputParameters = null) : bool
114155
{
115156
$result = $this->parent->execute($inputParameters);
116157
$this->log($inputParameters);
@@ -119,11 +160,24 @@ public function execute(array $inputParameters = null) : bool
119160

120161
/* Fetching */
121162

163+
/**
164+
* @param int $mode
165+
* @param mixed ...$args
166+
*
167+
* @return bool
168+
*/
122169
public function setFetchMode(int $mode, mixed ...$args) : bool
123170
{
124171
return $this->parent->setFetchMode($mode, ...$args);
125172
}
126173

174+
/**
175+
* @param int $fetch_style
176+
* @param int $cursor_orientation
177+
* @param int $cursor_offset
178+
*
179+
* @return mixed
180+
*/
127181
public function fetch(
128182
int $fetch_style = PDO::FETCH_DEFAULT,
129183
int $cursor_orientation = PDO::FETCH_ORI_NEXT,
@@ -133,6 +187,12 @@ public function fetch(
133187
return $this->parent->fetch($fetch_style, $cursor_orientation, $cursor_offset);
134188
}
135189

190+
/**
191+
* @param int $fetch_style
192+
* @param mixed ...$args
193+
*
194+
* @return array
195+
*/
136196
public function fetchAll(
137197
int $fetch_style = PDO::FETCH_DEFAULT,
138198
mixed ...$args
@@ -142,6 +202,11 @@ public function fetchAll(
142202
return $this->parent->fetchAll($fetch_style, ...$args);
143203
}
144204

205+
/**
206+
* @param int $column_number
207+
*
208+
* @return mixed
209+
*/
145210
public function fetchColumn(int $column_number = 0) : mixed
146211
{
147212
return $this->parent->fetchColumn($column_number);
@@ -165,50 +230,81 @@ public function fetchObject(
165230

166231
/* Metadata */
167232

233+
/**
234+
* @return int
235+
*/
168236
public function rowCount() : int
169237
{
170238
return $this->parent->rowCount();
171239
}
172240

241+
/**
242+
* @return int
243+
*/
173244
public function columnCount() : int
174245
{
175246
return $this->parent->columnCount();
176247
}
177248

249+
/**
250+
* @param int $column
251+
*
252+
* @return array|false
253+
*/
178254
public function getColumnMeta(int $column) : array|false
179255
{
180256
return $this->parent->getColumnMeta($column);
181257
}
182258

183259
/* Errors */
184260

261+
/**
262+
* @return string|null
263+
*/
185264
public function errorCode() : ?string
186265
{
187266
return $this->parent->errorCode();
188267
}
189268

269+
/**
270+
* @return array
271+
*/
190272
public function errorInfo() : array
191273
{
192274
return $this->parent->errorInfo();
193275
}
194276

195277
/* Other */
196278

279+
/**
280+
* @return bool
281+
*/
197282
public function closeCursor() : bool
198283
{
199284
return $this->parent->closeCursor();
200285
}
201286

287+
/**
288+
* @return bool|null
289+
*/
202290
public function debugDumpParams() : ?bool
203291
{
204292
return $this->parent->debugDumpParams();
205293
}
206294

295+
/**
296+
* @return bool
297+
*/
207298
public function nextRowset() : bool
208299
{
209300
return $this->parent->nextRowset();
210301
}
211302

303+
/**
304+
* @param array|null $inputParameters
305+
*
306+
* @return void
307+
*/
212308
private function log(?array $inputParameters) : void
213309
{
214310
if ($inputParameters !== null) {

0 commit comments

Comments
 (0)