Skip to content

Commit f093015

Browse files
authored
Fix class constant and property ID generation for the manual (#14249)
Related to php/doc-en#3367
1 parent c2a9166 commit f093015

File tree

7 files changed

+55
-205
lines changed

7 files changed

+55
-205
lines changed

build/gen_stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2584,7 +2584,7 @@ protected function getFieldSynopsisDefaultLinkend(): string
25842584
{
25852585
$className = str_replace(["\\", "_"], ["-", "-"], $this->name->class->toLowerString());
25862586

2587-
return "$className.constants." . strtolower(str_replace("_", "-", $this->name->getDeclarationName()));
2587+
return "$className.constants." . strtolower(str_replace(["__", "_"], ["", "-"], $this->name->getDeclarationName()));
25882588
}
25892589

25902590
protected function getFieldSynopsisName(): string
@@ -2919,7 +2919,7 @@ protected function getFieldSynopsisDefaultLinkend(): string
29192919
{
29202920
$className = str_replace(["\\", "_"], ["-", "-"], $this->name->class->toLowerString());
29212921

2922-
return "$className.props." . strtolower(str_replace("_", "-", $this->name->getDeclarationName()));
2922+
return "$className.props." . strtolower(str_replace(["__", "_"], ["", "-"], $this->name->getDeclarationName()));
29232923
}
29242924

29252925
protected function getFieldSynopsisName(): string

ext/ffi/ffi.stub.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
/** @not-serializable */
77
final class FFI
88
{
9-
/**
10-
* @cvalue __BIGGEST_ALIGNMENT__
11-
* @link ffi-ffi.constants.biggest-alignment
12-
*/
9+
/** @cvalue __BIGGEST_ALIGNMENT__ */
1310
public const int __BIGGEST_ALIGNMENT__ = UNKNOWN;
1411

1512
public static function cdef(string $code = "", ?string $lib = null): FFI {}

ext/ffi/ffi_arginfo.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/snmp/snmp.stub.php

Lines changed: 12 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -183,66 +183,30 @@ function snmp_read_mib(string $filename): bool {}
183183

184184
class SNMP
185185
{
186-
/**
187-
* @cvalue SNMP_VERSION_1
188-
* @link snmp.class.constants.version-1
189-
*/
186+
/** @cvalue SNMP_VERSION_1 */
190187
public const int VERSION_1 = UNKNOWN;
191-
/**
192-
* @cvalue SNMP_VERSION_2c
193-
* @link snmp.class.constants.version-2c
194-
*/
188+
/** @cvalue SNMP_VERSION_2c */
195189
public const int VERSION_2c = UNKNOWN;
196-
/**
197-
* @cvalue SNMP_VERSION_2c
198-
* @link snmp.class.constants.version-2c
199-
*/
190+
/** @cvalue SNMP_VERSION_2c */
200191
public const int VERSION_2C = UNKNOWN;
201-
/**
202-
* @cvalue SNMP_VERSION_3
203-
* @link snmp.class.constants.version-3
204-
*/
192+
/** @cvalue SNMP_VERSION_3 */
205193
public const int VERSION_3 = UNKNOWN;
206194

207-
/**
208-
* @cvalue PHP_SNMP_ERRNO_NOERROR
209-
* @link snmp.class.constants.errno-noerror
210-
*/
195+
/** @cvalue PHP_SNMP_ERRNO_NOERROR */
211196
public const int ERRNO_NOERROR = UNKNOWN;
212-
/**
213-
* @cvalue PHP_SNMP_ERRNO_ANY
214-
* @link snmp.class.constants.errno-any
215-
*/
197+
/** @cvalue PHP_SNMP_ERRNO_ANY */
216198
public const int ERRNO_ANY = UNKNOWN;
217-
/**
218-
* @cvalue PHP_SNMP_ERRNO_GENERIC
219-
* @link snmp.class.constants.errno-generic
220-
*/
199+
/** @cvalue PHP_SNMP_ERRNO_GENERIC */
221200
public const int ERRNO_GENERIC = UNKNOWN;
222-
/**
223-
* @cvalue PHP_SNMP_ERRNO_TIMEOUT
224-
* @link snmp.class.constants.errno-timeout
225-
*/
201+
/** @cvalue PHP_SNMP_ERRNO_TIMEOUT */
226202
public const int ERRNO_TIMEOUT = UNKNOWN;
227-
/**
228-
* @cvalue PHP_SNMP_ERRNO_ERROR_IN_REPLY
229-
* @link snmp.class.constants.errno-error-in-reply
230-
*/
203+
/** @cvalue PHP_SNMP_ERRNO_ERROR_IN_REPLY */
231204
public const int ERRNO_ERROR_IN_REPLY = UNKNOWN;
232-
/**
233-
* @cvalue PHP_SNMP_ERRNO_OID_NOT_INCREASING
234-
* @link snmp.class.constants.errno-oid-not-increasing
235-
*/
205+
/** @cvalue PHP_SNMP_ERRNO_OID_NOT_INCREASING */
236206
public const int ERRNO_OID_NOT_INCREASING = UNKNOWN;
237-
/**
238-
* @cvalue PHP_SNMP_ERRNO_OID_PARSING_ERROR
239-
* @link snmp.class.constants.errno-oid-parsing-error
240-
*/
207+
/** @cvalue PHP_SNMP_ERRNO_OID_PARSING_ERROR */
241208
public const int ERRNO_OID_PARSING_ERROR = UNKNOWN;
242-
/**
243-
* @cvalue PHP_SNMP_ERRNO_MULTIPLE_SET_QUERIES
244-
* @link snmp.class.constants.errno-multiple-set-queries
245-
*/
209+
/** @cvalue PHP_SNMP_ERRNO_MULTIPLE_SET_QUERIES */
246210
public const int ERRNO_MULTIPLE_SET_QUERIES = UNKNOWN;
247211

248212
/** @readonly */

ext/snmp/snmp_arginfo.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/sqlite3/sqlite3.stub.php

Lines changed: 37 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -78,197 +78,86 @@ class SQLite3Exception extends \Exception
7878
/** @not-serializable */
7979
class SQLite3
8080
{
81-
/**
82-
* @cvalue SQLITE_OK
83-
* @link sqlite3.class.constants.ok
84-
*/
81+
/** @cvalue SQLITE_OK */
8582
public const int OK = UNKNOWN;
8683

8784
/* Constants for authorizer return */
8885

89-
/**
90-
* @cvalue SQLITE_DENY
91-
* @link sqlite3.class.constants.deny
92-
*/
86+
/** @cvalue SQLITE_DENY */
9387
public const int DENY = UNKNOWN;
94-
/**
95-
* @cvalue SQLITE_IGNORE
96-
* @link sqlite3.class.constants.ignore
97-
*/
88+
/** @cvalue SQLITE_IGNORE */
9889
public const int IGNORE = UNKNOWN;
9990

10091
/* Constants for authorizer actions */
10192

102-
/**
103-
* @cvalue SQLITE_CREATE_INDEX
104-
* @link sqlite3.class.constants.create-index
105-
*/
93+
/** @cvalue SQLITE_CREATE_INDEX */
10694
public const int CREATE_INDEX = UNKNOWN;
107-
/**
108-
* @cvalue SQLITE_CREATE_TABLE
109-
* @link sqlite3.class.constants.create-table
110-
*/
95+
/** @cvalue SQLITE_CREATE_TABLE */
11196
public const int CREATE_TABLE = UNKNOWN;
112-
/**
113-
* @cvalue SQLITE_CREATE_TEMP_INDEX
114-
* @link sqlite3.class.constants.create-temp-index
115-
*/
97+
/** @cvalue SQLITE_CREATE_TEMP_INDEX */
11698
public const int CREATE_TEMP_INDEX = UNKNOWN;
117-
/**
118-
* @cvalue SQLITE_CREATE_TEMP_TABLE
119-
* @link sqlite3.class.constants.create-temp-table
120-
*/
99+
/** @cvalue SQLITE_CREATE_TEMP_TABLE */
121100
public const int CREATE_TEMP_TABLE = UNKNOWN;
122-
/**
123-
* @cvalue SQLITE_CREATE_TEMP_TRIGGER
124-
* @link sqlite3.class.constants.create-temp-trigger
125-
*/
101+
/** @cvalue SQLITE_CREATE_TEMP_TRIGGER */
126102
public const int CREATE_TEMP_TRIGGER = UNKNOWN;
127-
/**
128-
* @cvalue SQLITE_CREATE_TEMP_VIEW
129-
* @link sqlite3.class.constants.create-temp-view
130-
*/
103+
/** @cvalue SQLITE_CREATE_TEMP_VIEW */
131104
public const int CREATE_TEMP_VIEW = UNKNOWN;
132-
/**
133-
* @cvalue SQLITE_CREATE_TRIGGER
134-
* @link sqlite3.class.constants.create-trigger
135-
*/
105+
/** @cvalue SQLITE_CREATE_TRIGGER */
136106
public const int CREATE_TRIGGER = UNKNOWN;
137-
/**
138-
* @cvalue SQLITE_CREATE_VIEW
139-
* @link sqlite3.class.constants.create-view
140-
*/
107+
/** @cvalue SQLITE_CREATE_VIEW */
141108
public const int CREATE_VIEW = UNKNOWN;
142-
/**
143-
* @cvalue SQLITE_DELETE
144-
* @link sqlite3.class.constants.delete
145-
*/
109+
/** @cvalue SQLITE_DELETE */
146110
public const int DELETE = UNKNOWN;
147-
/**
148-
* @cvalue SQLITE_DROP_INDEX
149-
* @link sqlite3.class.constants.drop-index
150-
*/
111+
/** @cvalue SQLITE_DROP_INDEX */
151112
public const int DROP_INDEX = UNKNOWN;
152-
/**
153-
* @cvalue SQLITE_DROP_TABLE
154-
* @link sqlite3.class.constants.drop-table
155-
*/
113+
/** @cvalue SQLITE_DROP_TABLE */
156114
public const int DROP_TABLE = UNKNOWN;
157-
/**
158-
* @cvalue SQLITE_DROP_TEMP_INDEX
159-
* @link sqlite3.class.constants.drop-temp-index
160-
*/
115+
/** @cvalue SQLITE_DROP_TEMP_INDEX */
161116
public const int DROP_TEMP_INDEX = UNKNOWN;
162-
/**
163-
* @cvalue SQLITE_DROP_TEMP_TABLE
164-
* @link sqlite3.class.constants.drop-temp-table
165-
*/
117+
/** @cvalue SQLITE_DROP_TEMP_TABLE */
166118
public const int DROP_TEMP_TABLE = UNKNOWN;
167-
/**
168-
* @cvalue SQLITE_DROP_TEMP_TRIGGER
169-
* @link sqlite3.class.constants.drop-temp-trigger
170-
*/
119+
/** @cvalue SQLITE_DROP_TEMP_TRIGGER */
171120
public const int DROP_TEMP_TRIGGER = UNKNOWN;
172-
/**
173-
* @cvalue SQLITE_DROP_TEMP_VIEW
174-
* @link sqlite3.class.constants.drop-temp-view
175-
*/
121+
/** @cvalue SQLITE_DROP_TEMP_VIEW */
176122
public const int DROP_TEMP_VIEW = UNKNOWN;
177-
/**
178-
* @cvalue SQLITE_DROP_TRIGGER
179-
* @link sqlite3.class.constants.drop-trigger
180-
*/
123+
/** @cvalue SQLITE_DROP_TRIGGER */
181124
public const int DROP_TRIGGER = UNKNOWN;
182-
/**
183-
* @cvalue SQLITE_DROP_VIEW
184-
* @link sqlite3.class.constants.drop-view
185-
*/
125+
/** @cvalue SQLITE_DROP_VIEW */
186126
public const int DROP_VIEW = UNKNOWN;
187-
/**
188-
* @cvalue SQLITE_INSERT
189-
* @link sqlite3.class.constants.insert
190-
*/
127+
/** @cvalue SQLITE_INSERT */
191128
public const int INSERT = UNKNOWN;
192-
/**
193-
* @cvalue SQLITE_PRAGMA
194-
* @link sqlite3.class.constants.pragma
195-
*/
129+
/** @cvalue SQLITE_PRAGMA */
196130
public const int PRAGMA = UNKNOWN;
197-
/**
198-
* @cvalue SQLITE_READ
199-
* @link sqlite3.class.constants.read
200-
*/
131+
/** @cvalue SQLITE_READ */
201132
public const int READ = UNKNOWN;
202-
/**
203-
* @cvalue SQLITE_SELECT
204-
* @link sqlite3.class.constants.select
205-
*/
133+
/** @cvalue SQLITE_SELECT */
206134
public const int SELECT = UNKNOWN;
207-
/**
208-
* @cvalue SQLITE_TRANSACTION
209-
* @link sqlite3.class.constants.transaction
210-
*/
135+
/** @cvalue SQLITE_TRANSACTION */
211136
public const int TRANSACTION = UNKNOWN;
212-
/**
213-
* @cvalue SQLITE_UPDATE
214-
* @link sqlite3.class.constants.update
215-
*/
137+
/** @cvalue SQLITE_UPDATE */
216138
public const int UPDATE = UNKNOWN;
217-
/**
218-
* @cvalue SQLITE_ATTACH
219-
* @link sqlite3.class.constants.attach
220-
*/
139+
/** @cvalue SQLITE_ATTACH */
221140
public const int ATTACH = UNKNOWN;
222-
/**
223-
* @cvalue SQLITE_DETACH
224-
* @link sqlite3.class.constants.detach
225-
*/
141+
/** @cvalue SQLITE_DETACH */
226142
public const int DETACH = UNKNOWN;
227-
/**
228-
* @cvalue SQLITE_ALTER_TABLE
229-
* @link sqlite3.class.constants.alter-table
230-
*/
143+
/** @cvalue SQLITE_ALTER_TABLE */
231144
public const int ALTER_TABLE = UNKNOWN;
232-
/**
233-
* @cvalue SQLITE_REINDEX
234-
* @link sqlite3.class.constants.reindex
235-
*/
145+
/** @cvalue SQLITE_REINDEX */
236146
public const int REINDEX = UNKNOWN;
237-
/**
238-
* @cvalue SQLITE_ANALYZE
239-
* @link sqlite3.class.constants.analyze
240-
*/
147+
/** @cvalue SQLITE_ANALYZE */
241148
public const int ANALYZE = UNKNOWN;
242-
/**
243-
* @cvalue SQLITE_CREATE_VTABLE
244-
* @link sqlite3.class.constants.create-vtable
245-
*/
149+
/** @cvalue SQLITE_CREATE_VTABLE */
246150
public const int CREATE_VTABLE = UNKNOWN;
247-
/**
248-
* @cvalue SQLITE_DROP_VTABLE
249-
* @link sqlite3.class.constants.drop-vtable
250-
*/
151+
/** @cvalue SQLITE_DROP_VTABLE */
251152
public const int DROP_VTABLE = UNKNOWN;
252-
/**
253-
* @cvalue SQLITE_FUNCTION
254-
* @link sqlite3.class.constants.function
255-
*/
153+
/** @cvalue SQLITE_FUNCTION */
256154
public const int FUNCTION = UNKNOWN;
257-
/**
258-
* @cvalue SQLITE_SAVEPOINT
259-
* @link sqlite3.class.constants.savepoint
260-
*/
155+
/** @cvalue SQLITE_SAVEPOINT */
261156
public const int SAVEPOINT = UNKNOWN;
262-
/**
263-
* @cvalue SQLITE_COPY
264-
* @link sqlite3.class.constants.copy
265-
*/
157+
/** @cvalue SQLITE_COPY */
266158
public const int COPY = UNKNOWN;
267159
#ifdef SQLITE_RECURSIVE
268-
/**
269-
* @cvalue SQLITE_RECURSIVE
270-
* @link sqlite3.class.constants.recursive
271-
*/
160+
/** @cvalue SQLITE_RECURSIVE */
272161
public const int RECURSIVE = UNKNOWN;
273162
#endif
274163

ext/sqlite3/sqlite3_arginfo.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)