Skip to content

Commit de91282

Browse files
committed
Display string default values in stubs more uniformly
Settling on using quoted string
1 parent c76910c commit de91282

File tree

13 files changed

+32
-32
lines changed

13 files changed

+32
-32
lines changed

ext/hash/hash.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function hash_pbkdf2(string $algo, string $password, string $salt, int $iteratio
3232

3333
function hash_equals(string $known_string, string $user_string): bool {}
3434

35-
function hash_hkdf(string $algo, string $ikm, int $length = 0, string $info = '', string $salt = ''): string {}
35+
function hash_hkdf(string $algo, string $ikm, int $length = 0, string $info = "", string $salt = ""): string {}
3636

3737
#ifdef PHP_MHASH_BC
3838
function mhash_get_block_size(int $hash): int|false {}

ext/imap/php_imap.stub.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function imap_headerinfo($stream_id, int $msg_no, int $from_length = 0, int $sub
3535
*/
3636
function imap_header($stream_id, int $msg_no, int $from_length = 0, int $subject_length = 0, string $default_host = UNKNOWN): stdClass|false {}
3737

38-
function imap_rfc822_parse_headers(string $headers, string $default_host = 'UNKNOWN'): stdClass {}
38+
function imap_rfc822_parse_headers(string $headers, string $default_host = "UNKNOWN"): stdClass {}
3939

4040
function imap_rfc822_write_address(string $mailbox, string $host, string $personal): string|false {}
4141

@@ -66,7 +66,7 @@ function imap_fetchmime($stream_id, int $msg_no, string $section, int $options =
6666
* @param resource $stream_id
6767
* @param resource|string|int $file
6868
*/
69-
function imap_savebody($stream_id, $file, int $msg_no, string $section = '', int $options = 0): bool {}
69+
function imap_savebody($stream_id, $file, int $msg_no, string $section = "", int $options = 0): bool {}
7070

7171
/** @param resource $stream_id */
7272
function imap_fetchheader($stream_id, int $msg_no, int $options = 0): string|false {}
@@ -222,7 +222,7 @@ function imap_errors(): array|false {}
222222
function imap_last_error(): string|false {}
223223

224224
/** @param resource $stream_id */
225-
function imap_search($stream_id, string $criteria, int $options = SE_FREE, string $charset = ''): array|false {}
225+
function imap_search($stream_id, string $criteria, int $options = SE_FREE, string $charset = ""): array|false {}
226226

227227
function imap_utf7_decode(string $buf): string|false {}
228228

ext/ldap/ldap.stub.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ function ldap_compare($link_identifier, string $dn, string $attribute, string $v
193193
* @param resource $link
194194
* @deprecated since 7.4
195195
*/
196-
function ldap_control_paged_result($link, int $pagesize, bool $iscritical = false, string $cookie = ''): bool {}
196+
function ldap_control_paged_result($link, int $pagesize, bool $iscritical = false, string $cookie = ""): bool {}
197197

198198
/**
199199
* @param resource $link
@@ -281,7 +281,7 @@ function ldap_set_rebind_proc($link, ?callable $callback): bool {}
281281
function ldap_start_tls($link_identifier): bool {}
282282
#endif
283283

284-
function ldap_escape(string $value, string $ignore = '', int $flags = 0): string {}
284+
function ldap_escape(string $value, string $ignore = "", int $flags = 0): string {}
285285

286286
#ifdef STR_TRANSLATION
287287
function ldap_t61_to_8859(string $value): string|false {}
@@ -305,7 +305,7 @@ function ldap_exop($link, string $reqoid, ?string $reqdata = null, ?array $serve
305305
* @param resource $link
306306
* @param array $serverctrls
307307
*/
308-
function ldap_exop_passwd($link, string $user = '', string $oldpw = '', string $newpw = '', &$serverctrls = null): string|bool {}
308+
function ldap_exop_passwd($link, string $user = "", string $oldpw = "", string $newpw = "", &$serverctrls = null): string|bool {}
309309
#endif
310310

311311

ext/oci8/oci8.stub.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -332,38 +332,38 @@ function ocilogoff($connection_resource): ?bool {}
332332
/**
333333
* @return resource|false
334334
*/
335-
function oci_new_connect(string $username, string $password, ?string $connection_string = null, string $character_set = '', int $session_mode = OCI_DEFAULT) {}
335+
function oci_new_connect(string $username, string $password, ?string $connection_string = null, string $character_set = "", int $session_mode = OCI_DEFAULT) {}
336336

337337
/**
338338
* @return resource|false
339339
* @alias oci_new_connect
340340
* @deprecated
341341
*/
342-
function ocinlogon(string $username, string $password, ?string $connection_string = null, string $character_set = '', int $session_mode = OCI_DEFAULT) {}
342+
function ocinlogon(string $username, string $password, ?string $connection_string = null, string $character_set = "", int $session_mode = OCI_DEFAULT) {}
343343

344344
/**
345345
* @return resource|false
346346
*/
347-
function oci_connect(string $username, string $password, ?string $connection_string = null, string $character_set = '', int $session_mode = OCI_DEFAULT) {}
347+
function oci_connect(string $username, string $password, ?string $connection_string = null, string $character_set = "", int $session_mode = OCI_DEFAULT) {}
348348

349349
/**
350350
* @return resource|false
351351
* @alias oci_connect
352352
* @deprecated
353353
*/
354-
function ocilogon(string $username, string $password, ?string $connection_string = null, string $character_set = '', int $session_mode = OCI_DEFAULT) {}
354+
function ocilogon(string $username, string $password, ?string $connection_string = null, string $character_set = "", int $session_mode = OCI_DEFAULT) {}
355355

356356
/**
357357
* @return resource|false
358358
*/
359-
function oci_pconnect(string $username, string $password, ?string $connection_string = null, string $character_set = '', int $session_mode = OCI_DEFAULT) {}
359+
function oci_pconnect(string $username, string $password, ?string $connection_string = null, string $character_set = "", int $session_mode = OCI_DEFAULT) {}
360360

361361
/**
362362
* @return resource|false
363363
* @alias oci_pconnect
364364
* @deprecated
365365
*/
366-
function ociplogon(string $username, string $password, ?string $connection_string = null, string $character_set = '', int $session_mode = OCI_DEFAULT) {}
366+
function ociplogon(string $username, string $password, ?string $connection_string = null, string $character_set = "", int $session_mode = OCI_DEFAULT) {}
367367

368368
/**
369369
* @param resource|null $connection_or_statement_resource

ext/odbc/odbc.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function odbc_fetch_row($result_id, int $row_number = UNKNOWN): bool {}
6161
function odbc_result($result_id, string|int $field): string|bool|null {}
6262

6363
/** @param resource $result_id */
64-
function odbc_result_all($result_id, string $format = ''): int|false {}
64+
function odbc_result_all($result_id, string $format = ""): int|false {}
6565

6666
/** @param resource $result_id */
6767
function odbc_free_result($result_id): bool {}

ext/simplexml/simplexml.stub.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
/** @generate-function-entries */
44

5-
function simplexml_load_file(string $filename, ?string $class_name = SimpleXMLElement::class, int $options = 0, string $namespace_or_prefix = '', bool $is_prefix = false): SimpleXMLElement|false {}
5+
function simplexml_load_file(string $filename, ?string $class_name = SimpleXMLElement::class, int $options = 0, string $namespace_or_prefix = "", bool $is_prefix = false): SimpleXMLElement|false {}
66

7-
function simplexml_load_string(string $data, ?string $class_name = SimpleXMLElement::class, int $options = 0, string $namespace_or_prefix = '', bool $is_prefix = false): SimpleXMLElement|false {}
7+
function simplexml_load_string(string $data, ?string $class_name = SimpleXMLElement::class, int $options = 0, string $namespace_or_prefix = "", bool $is_prefix = false): SimpleXMLElement|false {}
88

99
function simplexml_import_dom(DOMNode $node, ?string $class_name = SimpleXMLElement::class): ?SimpleXMLElement {}
1010

@@ -37,7 +37,7 @@ public function children(?string $namespaceOrPrefix = null, bool $isPrefix = fal
3737
/** @return SimpleXMLIterator */
3838
public function attributes(?string $namespaceOrPrefix = null, bool $isPrefix = false) {}
3939

40-
public function __construct(string $data, int $options = 0, bool $dataIsURL = false, string $namespaceOrPrefix = '', bool $isPrefix = false) {}
40+
public function __construct(string $data, int $options = 0, bool $dataIsURL = false, string $namespaceOrPrefix = "", bool $isPrefix = false) {}
4141

4242
/** @return SimpleXMLElement */
4343
public function addChild(string $qualifiedName, ?string $value = null, ?string $namespace = null) {}

ext/snmp/snmp.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function __construct(int $version, string $host, string $community, int $
6060
public function close() {}
6161

6262
/** @return bool */
63-
public function setSecurity(string $sec_level, string $auth_protocol = '', string $auth_passphrase = '', string $priv_protocol = '', string $priv_passphrase = '', string $contextName = '', string $contextEngineID = '') {}
63+
public function setSecurity(string $sec_level, string $auth_protocol = "", string $auth_passphrase = "", string $priv_protocol = "", string $priv_passphrase = "", string $contextName = "", string $contextEngineID = "") {}
6464

6565
/** @return array|bool */
6666
public function get(array|string $object_id, bool $use_orignames = false) {}

ext/spl/spl_directory.stub.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function getPathInfo(?string $class_name = null) {}
8282
* @param resource|null $context
8383
* @return SplFileObject
8484
*/
85-
public function openFile(string $open_mode = 'r', bool $use_include_path = false, $context = null) {}
85+
public function openFile(string $open_mode = "r", bool $use_include_path = false, $context = null) {}
8686

8787
/** @return void */
8888
public function setFileClass(string $class_name = SplFileObject::class) {}
@@ -188,7 +188,7 @@ public function count() {}
188188
class SplFileObject extends SplFileInfo implements RecursiveIterator, SeekableIterator
189189
{
190190
/** @param resource|null $context */
191-
public function __construct(string $file_name, string $open_mode = 'r', bool $use_include_path = false, $context = null) {}
191+
public function __construct(string $file_name, string $open_mode = "r", bool $use_include_path = false, $context = null) {}
192192

193193
/** @return void */
194194
public function rewind() {}
@@ -206,10 +206,10 @@ public function fgets() {}
206206
public function fread(int $length) {}
207207

208208
/** @return array|false */
209-
public function fgetcsv(string $delimiter = ",", string $enclosure = '"', string $escape = "\\") {}
209+
public function fgetcsv(string $delimiter = ",", string $enclosure = "\"", string $escape = "\\") {}
210210

211211
/** @return int|false */
212-
public function fputcsv(array $fields, string $delimiter = ',', string $enclosure = '"', string $escape = "\\") {}
212+
public function fputcsv(array $fields, string $delimiter = ",", string $enclosure = "\"", string $escape = "\\") {}
213213

214214
/** @return bool|null */
215215
public function setCsvControl(string $delimiter = ",", string $enclosure = "\"", string $escape = "\\") {}

ext/sqlite3/sqlite3.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
class SQLite3
66
{
77
/** @alias SQLite3::open */
8-
public function __construct(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryption_key = '') {}
8+
public function __construct(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryption_key = "") {}
99

1010
/** @return void */
11-
public function open(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryption_key = '') {}
11+
public function open(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryption_key = "") {}
1212

1313
/** @return bool */
1414
public function close() {}

ext/standard/basic_functions.stub.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,9 @@ function header(string $string, bool $replace = true, int $http_response_code =
502502

503503
function header_remove(?string $name = null): void {}
504504

505-
function setrawcookie(string $name, string $value = '', array|int $expires_or_options = 0, string $path = '', string $domain = '', bool $secure = false, bool $httponly = false): bool {}
505+
function setrawcookie(string $name, string $value = "", array|int $expires_or_options = 0, string $path = "", string $domain = "", bool $secure = false, bool $httponly = false): bool {}
506506

507-
function setcookie(string $name, string $value = '', array|int $expires_or_options = 0, string $path = '', string $domain = '', bool $secure = false, bool $httponly = false): bool {}
507+
function setcookie(string $name, string $value = "", array|int $expires_or_options = 0, string $path = "", string $domain = "", bool $secure = false, bool $httponly = false): bool {}
508508

509509
function http_response_code(int $response_code = 0): int|bool {}
510510

@@ -660,7 +660,7 @@ function setlocale(int $category, $locales, ...$rest): string|false {}
660660
/** @param array $result */
661661
function parse_str(string $encoded_string, &$result): void {}
662662

663-
function str_getcsv(string $string, string $delimiter = ',', string $enclosure = '"', string $escape = '\\'): array {}
663+
function str_getcsv(string $string, string $delimiter = ",", string $enclosure = "\"", string $escape = '\\'): array {}
664664

665665
function str_repeat(string $input, int $mult): string {}
666666

@@ -865,7 +865,7 @@ function file_put_contents(string $filename, mixed $content, int $flags = 0, $co
865865
function fputcsv($handle, array $fields, string $delimiter = ",", string $enclosure = "\"", string $escape = "\\"): int|false {}
866866

867867
/** @param resource $handle */
868-
function fgetcsv($handle, ?int $length = null, string $delimiter = ",", string $enclosure = '"', string $escape = "\\"): array|false {}
868+
function fgetcsv($handle, ?int $length = null, string $delimiter = ",", string $enclosure = "\"", string $escape = "\\"): array|false {}
869869

870870
function realpath(string $path): string|false {}
871871

ext/xml/xml.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
function xml_parser_create(?string $encoding = null): XmlParser {}
66

7-
function xml_parser_create_ns(?string $encoding = null, string $sep = ':'): XmlParser {}
7+
function xml_parser_create_ns(?string $encoding = null, string $sep = ":"): XmlParser {}
88

99
function xml_set_object(XmlParser $parser, object $obj): bool {}
1010

ext/xmlwriter/php_xmlwriter.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function xmlwriter_text(XMLWriter $xmlwriter, string $content): bool {}
5252

5353
function xmlwriter_write_raw(XMLWriter $xmlwriter, string $content): bool {}
5454

55-
function xmlwriter_start_document(XMLWriter $xmlwriter, ?string $version = '1.0', ?string $encoding = null, ?string $standalone = null): bool {}
55+
function xmlwriter_start_document(XMLWriter $xmlwriter, ?string $version = "1.0", ?string $encoding = null, ?string $standalone = null): bool {}
5656

5757
function xmlwriter_end_document(XMLWriter $xmlwriter): bool {}
5858

@@ -164,7 +164,7 @@ public function text(string $content): bool {}
164164
public function writeRaw(string $content): bool {}
165165

166166
/** @alias xmlwriter_start_document */
167-
public function startDocument(?string $version = '1.0', ?string $encoding = null, ?string $standalone = null): bool {}
167+
public function startDocument(?string $version = "1.0", ?string $encoding = null, ?string $standalone = null): bool {}
168168

169169
/** @alias xmlwriter_end_document */
170170
public function endDocument(): bool {}

ext/zip/php_zip.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function zip_read($zip) {}
2626
* @param resource $zip_entry
2727
* @deprecated
2828
*/
29-
function zip_entry_open($zip_dp, $zip_entry, string $mode = 'rb'): bool {}
29+
function zip_entry_open($zip_dp, $zip_entry, string $mode = "rb"): bool {}
3030

3131
/**
3232
* @param resource $zip_ent

0 commit comments

Comments
 (0)