Skip to content

Declare ext/phar constants in stubs #9094

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions ext/phar/phar_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -5055,9 +5055,6 @@ PHP_METHOD(PharFileInfo, decompress)

/* {{{ phar methods */

#define REGISTER_PHAR_CLASS_CONST_LONG(class_name, const_name, value) \
zend_declare_class_constant_long(class_name, const_name, sizeof(const_name)-1, (zend_long)value);

void phar_object_init(void) /* {{{ */
{
phar_ce_PharException = register_class_PharException(zend_ce_exception);
Expand All @@ -5067,22 +5064,5 @@ void phar_object_init(void) /* {{{ */
phar_ce_data = register_class_PharData(spl_ce_RecursiveDirectoryIterator, zend_ce_countable, zend_ce_arrayaccess);

phar_ce_entry = register_class_PharFileInfo(spl_ce_SplFileInfo);

REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "BZ2", PHAR_ENT_COMPRESSED_BZ2)
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "GZ", PHAR_ENT_COMPRESSED_GZ)
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "NONE", PHAR_ENT_COMPRESSED_NONE)
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "PHAR", PHAR_FORMAT_PHAR)
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "TAR", PHAR_FORMAT_TAR)
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "ZIP", PHAR_FORMAT_ZIP)
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "COMPRESSED", PHAR_ENT_COMPRESSION_MASK)
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "PHP", PHAR_MIME_PHP)
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "PHPS", PHAR_MIME_PHPS)
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "MD5", PHAR_SIG_MD5)
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "OPENSSL", PHAR_SIG_OPENSSL)
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "OPENSSL_SHA256", PHAR_SIG_OPENSSL_SHA256)
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "OPENSSL_SHA512", PHAR_SIG_OPENSSL_SHA512)
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "SHA1", PHAR_SIG_SHA1)
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "SHA256", PHAR_SIG_SHA256)
REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "SHA512", PHAR_SIG_SHA512)
}
/* }}} */
81 changes: 81 additions & 0 deletions ext/phar/phar_object.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,87 @@ class PharException extends Exception

class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess
{
/**
* @var int
* @cvalue PHAR_ENT_COMPRESSED_BZ2
*/
const BZ2 = UNKNOWN;
/**
* @var int
* @cvalue PHAR_ENT_COMPRESSED_GZ
*/
const GZ = UNKNOWN;
/**
* @var int
* @cvalue PHAR_ENT_COMPRESSED_NONE
*/
const NONE = UNKNOWN;
/**
* @var int
* @cvalue PHAR_FORMAT_PHAR
*/
const PHAR = UNKNOWN;
/**
* @var int
* @cvalue PHAR_FORMAT_TAR
*/
const TAR = UNKNOWN;
/**
* @var int
* @cvalue PHAR_FORMAT_ZIP
*/
const ZIP = UNKNOWN;
/**
* @var int
* @cvalue PHAR_ENT_COMPRESSION_MASK
*/
const COMPRESSED = UNKNOWN;
/**
* @var int
* @cvalue PHAR_MIME_PHP
*/
const PHP = UNKNOWN;
/**
* @var int
* @cvalue PHAR_MIME_PHPS
*/
const PHPS = UNKNOWN;
/**
* @var int
* @cvalue PHAR_SIG_MD5
*/
const MD5 = UNKNOWN;
/**
* @var int
* @cvalue PHAR_SIG_OPENSSL
*/
const OPENSSL = UNKNOWN;
/**
* @var int
* @cvalue PHAR_SIG_OPENSSL_SHA256
*/
const OPENSSL_SHA256 = UNKNOWN;
/**
* @var int
* @cvalue PHAR_SIG_OPENSSL_SHA512
*/
const OPENSSL_SHA512 = UNKNOWN;
/**
* @var int
* @cvalue PHAR_SIG_SHA1
*/
const SHA1 = UNKNOWN;
/**
* @var int
* @cvalue PHAR_SIG_SHA256
*/
const SHA256 = UNKNOWN;
/**
* @var int
* @cvalue PHAR_SIG_SHA512
*/
const SHA512 = UNKNOWN;

public function __construct(string $filename, int $flags = FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS, ?string $alias = null) {}

public function __destruct() {}
Expand Down
98 changes: 97 additions & 1 deletion ext/phar/phar_object_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.