Skip to content

Commit 6ab897c

Browse files
authored
Declare ext/phar constants in stubs (#9094)
1 parent 17f3631 commit 6ab897c

File tree

3 files changed

+178
-21
lines changed

3 files changed

+178
-21
lines changed

ext/phar/phar_object.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5055,9 +5055,6 @@ PHP_METHOD(PharFileInfo, decompress)
50555055

50565056
/* {{{ phar methods */
50575057

5058-
#define REGISTER_PHAR_CLASS_CONST_LONG(class_name, const_name, value) \
5059-
zend_declare_class_constant_long(class_name, const_name, sizeof(const_name)-1, (zend_long)value);
5060-
50615058
void phar_object_init(void) /* {{{ */
50625059
{
50635060
phar_ce_PharException = register_class_PharException(zend_ce_exception);
@@ -5067,22 +5064,5 @@ void phar_object_init(void) /* {{{ */
50675064
phar_ce_data = register_class_PharData(spl_ce_RecursiveDirectoryIterator, zend_ce_countable, zend_ce_arrayaccess);
50685065

50695066
phar_ce_entry = register_class_PharFileInfo(spl_ce_SplFileInfo);
5070-
5071-
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "BZ2", PHAR_ENT_COMPRESSED_BZ2)
5072-
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "GZ", PHAR_ENT_COMPRESSED_GZ)
5073-
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "NONE", PHAR_ENT_COMPRESSED_NONE)
5074-
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "PHAR", PHAR_FORMAT_PHAR)
5075-
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "TAR", PHAR_FORMAT_TAR)
5076-
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "ZIP", PHAR_FORMAT_ZIP)
5077-
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "COMPRESSED", PHAR_ENT_COMPRESSION_MASK)
5078-
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "PHP", PHAR_MIME_PHP)
5079-
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "PHPS", PHAR_MIME_PHPS)
5080-
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "MD5", PHAR_SIG_MD5)
5081-
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "OPENSSL", PHAR_SIG_OPENSSL)
5082-
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "OPENSSL_SHA256", PHAR_SIG_OPENSSL_SHA256)
5083-
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "OPENSSL_SHA512", PHAR_SIG_OPENSSL_SHA512)
5084-
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "SHA1", PHAR_SIG_SHA1)
5085-
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "SHA256", PHAR_SIG_SHA256)
5086-
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "SHA512", PHAR_SIG_SHA512)
50875067
}
50885068
/* }}} */

ext/phar/phar_object.stub.php

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,87 @@ class PharException extends Exception
88

99
class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess
1010
{
11+
/**
12+
* @var int
13+
* @cvalue PHAR_ENT_COMPRESSED_BZ2
14+
*/
15+
const BZ2 = UNKNOWN;
16+
/**
17+
* @var int
18+
* @cvalue PHAR_ENT_COMPRESSED_GZ
19+
*/
20+
const GZ = UNKNOWN;
21+
/**
22+
* @var int
23+
* @cvalue PHAR_ENT_COMPRESSED_NONE
24+
*/
25+
const NONE = UNKNOWN;
26+
/**
27+
* @var int
28+
* @cvalue PHAR_FORMAT_PHAR
29+
*/
30+
const PHAR = UNKNOWN;
31+
/**
32+
* @var int
33+
* @cvalue PHAR_FORMAT_TAR
34+
*/
35+
const TAR = UNKNOWN;
36+
/**
37+
* @var int
38+
* @cvalue PHAR_FORMAT_ZIP
39+
*/
40+
const ZIP = UNKNOWN;
41+
/**
42+
* @var int
43+
* @cvalue PHAR_ENT_COMPRESSION_MASK
44+
*/
45+
const COMPRESSED = UNKNOWN;
46+
/**
47+
* @var int
48+
* @cvalue PHAR_MIME_PHP
49+
*/
50+
const PHP = UNKNOWN;
51+
/**
52+
* @var int
53+
* @cvalue PHAR_MIME_PHPS
54+
*/
55+
const PHPS = UNKNOWN;
56+
/**
57+
* @var int
58+
* @cvalue PHAR_SIG_MD5
59+
*/
60+
const MD5 = UNKNOWN;
61+
/**
62+
* @var int
63+
* @cvalue PHAR_SIG_OPENSSL
64+
*/
65+
const OPENSSL = UNKNOWN;
66+
/**
67+
* @var int
68+
* @cvalue PHAR_SIG_OPENSSL_SHA256
69+
*/
70+
const OPENSSL_SHA256 = UNKNOWN;
71+
/**
72+
* @var int
73+
* @cvalue PHAR_SIG_OPENSSL_SHA512
74+
*/
75+
const OPENSSL_SHA512 = UNKNOWN;
76+
/**
77+
* @var int
78+
* @cvalue PHAR_SIG_SHA1
79+
*/
80+
const SHA1 = UNKNOWN;
81+
/**
82+
* @var int
83+
* @cvalue PHAR_SIG_SHA256
84+
*/
85+
const SHA256 = UNKNOWN;
86+
/**
87+
* @var int
88+
* @cvalue PHAR_SIG_SHA512
89+
*/
90+
const SHA512 = UNKNOWN;
91+
1192
public function __construct(string $filename, int $flags = FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS, ?string $alias = null) {}
1293

1394
public function __destruct() {}

ext/phar/phar_object_arginfo.h

Lines changed: 97 additions & 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)