Skip to content

Commit 2b4fee0

Browse files
committed
Mark ext/mysqli properties as readonly for documentation purposes
1 parent 60fdca5 commit 2b4fee0

File tree

2 files changed

+125
-32
lines changed

2 files changed

+125
-32
lines changed

ext/mysqli/mysqli.stub.php

+124-31
Original file line numberDiff line numberDiff line change
@@ -20,58 +20,112 @@ final class mysqli_driver
2020

2121
class mysqli
2222
{
23-
/** @link mysqli.affected-rows */
23+
/**
24+
* @readonly
25+
* @link mysqli.affected-rows
26+
*/
2427
public int|string $affected_rows;
2528

26-
/** @link mysqli.get-client-info */
29+
/**
30+
* @readonly
31+
* @link mysqli.get-client-info
32+
*/
2733
public string $client_info;
2834

29-
/** @link mysqli.get-client-version */
35+
/**
36+
* @readonly
37+
* @link mysqli.get-client-version
38+
*/
3039
public int $client_version;
3140

32-
/** @link mysqli.connect-errno */
41+
/**
42+
* @readonly
43+
* @link mysqli.connect-errno
44+
*/
3345
public int $connect_errno;
3446

35-
/** @link mysqli.connect-error */
47+
/**
48+
* @readonly
49+
* @link mysqli.connect-error
50+
*/
3651
public ?string $connect_error;
3752

38-
/** @link mysqli.errno */
53+
/**
54+
* @readonly
55+
* @link mysqli.errno
56+
*/
3957
public int $errno;
4058

41-
/** @link mysqli.error */
59+
/**
60+
* @readonly
61+
* @link mysqli.error
62+
*/
4263
public string $error;
4364

44-
/** @link mysqli.error-list */
65+
/**
66+
* @readonly
67+
* @link mysqli.error-list
68+
*/
4569
public array $error_list;
4670

47-
/** @link mysqli.field-count */
71+
/**
72+
* @readonly
73+
* @link mysqli.field-count
74+
*/
4875
public int $field_count;
4976

50-
/** @link mysqli.get-host-info */
77+
/**
78+
* @readonly
79+
* @link mysqli.get-host-info
80+
*/
5181
public string $host_info;
5282

53-
/** @link mysqli.info */
83+
/**
84+
* @readonly
85+
* @link mysqli.info
86+
*/
5487
public ?string $info;
5588

56-
/** @link mysqli.insert-id */
89+
/**
90+
* @readonly
91+
* @link mysqli.insert-id
92+
*/
5793
public int|string $insert_id;
5894

59-
/** @link mysqli.get-server-info */
95+
/**
96+
* @readonly
97+
* @link mysqli.get-server-info
98+
*/
6099
public string $server_info;
61100

62-
/** @link mysqli.get-server-version */
101+
/**
102+
* @readonly
103+
* @link mysqli.get-server-version
104+
*/
63105
public int $server_version;
64106

65-
/** @link mysqli.sqlstate */
107+
/**
108+
* @readonly
109+
* @link mysqli.sqlstate
110+
*/
66111
public string $sqlstate;
67112

68-
/** @link mysqli.get-proto-info */
113+
/**
114+
* @readonly
115+
* @link mysqli.get-proto-info
116+
*/
69117
public int $protocol_version;
70118

71-
/** @link mysqli.thread-id */
119+
/**
120+
* @readonly
121+
* @link mysqli.thread-id
122+
*/
72123
public int $thread_id;
73124

74-
/** @link mysqli.warning-count */
125+
/**
126+
* @readonly
127+
* @link mysqli.warning-count
128+
*/
75129
public int $warning_count;
76130

77131
public function __construct(
@@ -373,16 +427,28 @@ public function refresh(int $flags): bool {}
373427

374428
class mysqli_result implements IteratorAggregate
375429
{
376-
/** @link mysqli-result.current-field */
430+
/**
431+
* @readonly
432+
* @link mysqli-result.current-field
433+
*/
377434
public int $current_field;
378435

379-
/** @link mysqli-result.field-count */
436+
/**
437+
* @readonly
438+
* @link mysqli-result.field-count
439+
*/
380440
public int $field_count;
381441

382-
/** @link mysqli-result.lengths */
442+
/**
443+
* @readonly
444+
* @link mysqli-result.lengths
445+
*/
383446
public ?array $lengths;
384447

385-
/** @link mysqli-result.num-rows */
448+
/**
449+
* @readonly
450+
* @link mysqli-result.num-rows
451+
*/
386452
public int|string $num_rows;
387453

388454
public int $type;
@@ -480,31 +546,58 @@ public function getIterator(): Iterator {}
480546

481547
class mysqli_stmt
482548
{
483-
/** @link mysqli-stmt.affected-rows */
549+
/**
550+
* @readonly
551+
* @link mysqli-stmt.affected-rows
552+
*/
484553
public int|string $affected_rows;
485554

486-
/** @link mysqli-stmt.insert-id */
555+
/**
556+
* @readonly
557+
* @link mysqli-stmt.insert-id
558+
*/
487559
public int|string $insert_id;
488560

489-
/** @link mysqli-stmt.num-rows */
561+
/**
562+
* @readonly
563+
* @link mysqli-stmt.num-rows
564+
*/
490565
public int|string $num_rows;
491566

492-
/** @link mysqli-stmt.param-count */
567+
/**
568+
* @readonly
569+
* @link mysqli-stmt.param-count
570+
*/
493571
public int $param_count;
494572

495-
/** @link mysqli-stmt.field-count */
573+
/**
574+
* @readonly
575+
* @link mysqli-stmt.field-count
576+
*/
496577
public int $field_count;
497578

498-
/** @link mysqli-stmt.errno */
579+
/**
580+
* @readonly
581+
* @link mysqli-stmt.errno
582+
*/
499583
public int $errno;
500584

501-
/** @link mysqli-stmt.error */
585+
/**
586+
* @readonly
587+
* @link mysqli-stmt.error
588+
*/
502589
public string $error;
503590

504-
/** @link mysqli-stmt.error-list */
591+
/**
592+
* @readonly
593+
* @link mysqli-stmt.error-list
594+
*/
505595
public array $error_list;
506596

507-
/** @link mysqli-stmt.sqlstate */
597+
/**
598+
* @readonly
599+
* @link mysqli-stmt.sqlstate
600+
*/
508601
public string $sqlstate;
509602

510603
public int $id;

ext/mysqli/mysqli_arginfo.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 7901d2cbbf9663f2c0cc140870baed0fe04c2bd1 */
2+
* Stub hash: 9ef8917aa1b4fe7420fe12c5629ef00f36df3256 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_affected_rows, 0, 1, MAY_BE_LONG|MAY_BE_STRING)
55
ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0)

0 commit comments

Comments
 (0)