Provide PHP 8 types to function signatures

Use LanguageLevelTypeAware
This commit is contained in:
Maxim.Kolmakov 2020-11-18 13:41:19 +01:00
parent 4c2a5f87b8
commit 697123f334
13 changed files with 333 additions and 275 deletions

View File

@ -90,11 +90,11 @@ function curl_init (string $url) {}
/**
* Copy a cURL handle along with all of its preferences
* @link https://php.net/manual/en/function.curl-copy-handle.php
* @param resource $handle
* @param CurlHandle|resource $handle
* @return resource a new cURL handle.
*/
#[Pure]
function curl_copy_handle ($handle) {}
function curl_copy_handle (#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $handle) {}
/**
* Gets cURL version information
@ -159,7 +159,7 @@ function curl_version ($age = null) {}
/**
* Set an option for a cURL transfer
* @link https://php.net/manual/en/function.curl-setopt.php
* @param resource $handle
* @param CurlHandle|resource $handle
* @param int $option <p>
* The CURLOPT_XXX option to set.
* </p>
@ -2122,12 +2122,12 @@ function curl_version ($age = null) {}
* </table>
* @return bool true on success or false on failure.
*/
function curl_setopt ($handle, $option, $value) {}
function curl_setopt (#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $handle, int $option, mixed $value) {}
/**
* Set multiple options for a cURL transfer
* @link https://php.net/manual/en/function.curl-setopt-array.php
* @param resource $handle
* @param CurlHandle|resource $handle
* @param array $options <p>
* An array specifying which options to set and their values.
* The keys should be valid curl_setopt constants or
@ -2138,19 +2138,19 @@ function curl_setopt ($handle, $option, $value) {}
* future options in the options array.
* @since 5.1.3
*/
function curl_setopt_array ($handle, array $options) {}
function curl_setopt_array (#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $handle, array $options) {}
/**
* (PHP 5 &gt;=5.5.0)<br/>
* Close a cURL share handle
* @link https://secure.php.net/manual/en/function.curl-share-close.php
* @param resource $share_handle <p>
* @param CurlShareHandle|resource $share_handle <p>
* A cURL share handle returned by {@link https://secure.php.net/manual/en/function.curl-share-init.php curl_share_init()}
* </p>
* @return void
* @since 5.5
*/
function curl_share_close ($share_handle) {}
function curl_share_close (#[LanguageLevelTypeAware(["8.0" => "CurlShareHandle"], default: "resource")] $share_handle) {}
/**
* (PHP 5 &gt;=5.5.0)<br/>
@ -2165,7 +2165,7 @@ function curl_share_init () {}
* (PHP 5 &gt;=5.5.0)<br/>
* Set an option for a cURL share handle.
* @link https://secure.php.net/manual/en/function.curl-share-setopt.php
* @param resource $share_handle <p>
* @param CurlShareHandle|resource $share_handle <p>
* A cURL share handle returned by {@link https://secure.php.net/manual/en/function.curl-share-init.php curl_share_init()}.
* </p>
* @param int $option <table>
@ -2240,7 +2240,7 @@ function curl_share_init () {}
* Returns <b>TRUE</b> on success or <b>FALSE</b> on failure.
* @since 5.5
*/
function curl_share_setopt ($share_handle, $option, $value ) {}
function curl_share_setopt (#[LanguageLevelTypeAware(["8.0" => "CurlShareHandle"], default: "resource")] $share_handle, int $option, mixed $value ) {}
/**
* (PHP 5 &gt;=5.5.0)<br/>
@ -2259,7 +2259,7 @@ function curl_strerror (int $error_code) {}
* (PHP 5 &gt;=5.5.0)<br/>
* Decodes the given URL encoded string
* @link https://secure.php.net/manual/en/function.curl-unescape.php
* @param resource $handle <p>A cURL handle returned by
* @param CurlHandle|resource $handle <p>A cURL handle returned by
* {@link https://secure.php.net/manual/en/function.curl-init.php curl_init()}.</p>
* @param string $string <p>
* The URL encoded string to be decoded.
@ -2268,20 +2268,20 @@ function curl_strerror (int $error_code) {}
* @since 5.5
*/
#[Pure]
function curl_unescape ($handle, $string) {}
function curl_unescape (#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $handle, string $string) {}
/**
* Perform a cURL session
* @link https://php.net/manual/en/function.curl-exec.php
* @param resource $handle
* @param CurlHandle|resource $handle
* @return string|bool true on success or false on failure. However, if the CURLOPT_RETURNTRANSFER
* option is set, it will return the result on success, false on failure.
*/
function curl_exec ($handle) {}
function curl_exec (#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $handle) {}
/**
* Get information regarding a specific transfer
* @link https://php.net/manual/en/function.curl-getinfo.php
* @param resource $handle
* @param CurlHandle|resource $handle
* @param int $option [optional] <p>
* This may be one of the following constants:
* CURLINFO_EFFECTIVE_URL - Last effective URL
@ -2310,32 +2310,32 @@ function curl_exec ($handle) {}
* "redirect_time"
*/
#[Pure]
function curl_getinfo ($handle, $option = null) {}
function curl_getinfo (#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $handle, int $option) {}
/**
* Return a string containing the last error for the current session
* @link https://php.net/manual/en/function.curl-error.php
* @param resource $handle
* @param CurlHandle|resource $handle
* @return string the error message or '' (the empty string) if no
* error occurred.
*/
#[Pure]
function curl_error ($handle) {}
function curl_error (#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $handle) {}
/**
* Return the last error number
* @link https://php.net/manual/en/function.curl-errno.php
* @param resource $handle
* @param CurlHandle|resource $handle
* @return int the error number or 0 (zero) if no error
* occurred.
*/
#[Pure]
function curl_errno ($handle) {}
function curl_errno (#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $handle) {}
/**
* URL encodes the given string
* @link https://secure.php.net/manual/en/function.curl-escape.php
* @param resource $handle <p>
* @param CurlHandle|resource $handle <p>
* A cURL handle returned by
* {@link https://secure.php.net/manual/en/function.curl-init.php curl_init()}.</p>
* @param string $string <p>
@ -2344,7 +2344,7 @@ function curl_errno ($handle) {}
* @since 5.5
*/
#[Pure]
function curl_escape($handle, $string) {}
function curl_escape(#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $handle, string $string) {}
/**
* (PHP 5 >= 5.5.0) <br/>
@ -2358,15 +2358,15 @@ function curl_escape($handle, $string) {}
* @since 5.5
*/
#[Pure]
function curl_file_create($filename, $mime_type = '', $posted_filename = '') {}
function curl_file_create(string $filename, string $mime_type = '', string $posted_filename = '') {}
/**
* Close a cURL session
* @link https://php.net/manual/en/function.curl-close.php
* @param resource $handle
* @param CurlHandle|resource $handle
* @return void
*/
function curl_close ($handle) {}
function curl_close (#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $handle) {}
/**
* Returns a new cURL multi handle
@ -2378,39 +2378,39 @@ function curl_multi_init () {}
/**
* Add a normal cURL handle to a cURL multi handle
* @link https://php.net/manual/en/function.curl-multi-add-handle.php
* @param resource $multi_handle
* @param resource $handle
* @param CurlMultiHandle|resource $multi_handle
* @param CurlHandle|resource $handle
* @return int 0 on success, or one of the CURLM_XXX errors
* code.
*/
function curl_multi_add_handle ($multi_handle, $handle) {}
function curl_multi_add_handle (#[LanguageLevelTypeAware(["8.0" => "CurlMultiHandle"], default: "resource")] $multi_handle, #[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $handle) {}
/**
* Remove a multi handle from a set of cURL handles
* @link https://php.net/manual/en/function.curl-multi-remove-handle.php
* @param resource $multi_handle
* @param resource $handle
* @param CurlMultiHandle|resource $multi_handle
* @param CurlHandle|resource $handle
* @return int|false On success, returns one of the CURLM_XXX error codes, false on failure.
*/
function curl_multi_remove_handle ($multi_handle, $handle) {}
function curl_multi_remove_handle (#[LanguageLevelTypeAware(["8.0" => "CurlMultiHandle"], default: "resource")] $multi_handle, #[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $handle) {}
/**
* Wait for activity on any curl_multi connection
* @link https://php.net/manual/en/function.curl-multi-select.php
* @param resource $multi_handle
* @param CurlMultiHandle|resource $multi_handle
* @param float $timeout [optional] <p>
* Time, in seconds, to wait for a response.
* </p>
* @return int On success, returns the number of descriptors contained in,
* the descriptor sets. On failure, this function will return -1 on a select failure or timeout (from the underlying select system call).
*/
function curl_multi_select ($multi_handle, $timeout = 1.0) {}
function curl_multi_select (#[LanguageLevelTypeAware(["8.0" => "CurlMultiHandle"], default: "resource")] $multi_handle, float $timeout = 1.0) {}
/**
* (PHP 5 &gt;=5.5.0)<br/>
* Set an option for the cURL multi handle
* @link https://secure.php.net/manual/en/function.curl-multi-setopt.php
* @param resource $multi_handle
* @param CurlMultiHandle|resource $multi_handle
* @param int $option <p>
* One of the <b>CURLMOPT_*</b> constants.
* </p>
@ -2457,7 +2457,7 @@ function curl_multi_select ($multi_handle, $timeout = 1.0) {}
* @return bool Returns TRUE on success or FALSE on failure.
* @since 5.5
*/
function curl_multi_setopt ($multi_handle, $option, $value) {}
function curl_multi_setopt (#[LanguageLevelTypeAware(["8.0" => "CurlMultiHandle"], default: "resource")] $multi_handle, int $option, mixed $value) {}
/**
* (PHP 5 &gt;=5.5.0)<br/>
@ -2475,29 +2475,29 @@ function curl_multi_strerror (int $error_code) {}
* (PHP 5 &gt;=5.5.0)<br/>
* Pause and unpause a connection
* @link https://secure.php.net/manual/en/function.curl-pause.php
* @param resource $handle
* @param CurlHandle|resource $handle
* <p>A cURL handle returned by {@link https://secure.php.net/manual/en/function.curl-init.php curl_init()}.</p>
* @param int $flags <p>One of <b>CURLPAUSE_*</b> constants.</p>
* @return int Returns an error code (<b>CURLE_OK</b> for no error).
* @since 5.5
*/
function curl_pause ($handle, $flags) {}
function curl_pause (#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $handle, int $flags) {}
/**
* (PHP 5 &gt;=5.5.0)<br/>
* Reset all options of a libcurl session handle
* @link https://secure.php.net/manual/en/function.curl-reset.php
* @param resource $handle <p>A cURL handle returned by
* @param CurlHandle|resource $handle <p>A cURL handle returned by
* {@link https://secure.php.net/manual/en/function.curl-init.php curl_init()}.</p>
* @return void
* @since 5.5
*/
function curl_reset ($handle) {}
function curl_reset (#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $handle) {}
/**
* Run the sub-connections of the current cURL handle
* @link https://php.net/manual/en/function.curl-multi-exec.php
* @param resource $multi_handle
* @param CurlMultiHandle|resource $multi_handle
* @param int &$still_running <p>
* A reference to a flag to tell whether the operations are still running.
* </p>
@ -2508,54 +2508,54 @@ function curl_reset ($handle) {}
* occurred problems on individual transfers even when this function returns
* CURLM_OK.
*/
function curl_multi_exec ($multi_handle, &$still_running) {}
function curl_multi_exec (#[LanguageLevelTypeAware(["8.0" => "CurlMultiHandle"], default: "resource")] $multi_handle, &$still_running) {}
/**
* Return the content of a cURL handle if <constant>CURLOPT_RETURNTRANSFER</constant> is set
* @link https://php.net/manual/en/function.curl-multi-getcontent.php
* @param resource $multi_handle
* @param CurlHandle|resource $multi_handle
* @return string Return the content of a cURL handle if CURLOPT_RETURNTRANSFER is set.
*/
#[Pure]
function curl_multi_getcontent ($multi_handle) {}
function curl_multi_getcontent (#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $multi_handle) {}
/**
* Get information about the current transfers
* @link https://php.net/manual/en/function.curl-multi-info-read.php
* @param resource $multi_handle
* @param CurlMultiHandle|resource $multi_handle
* @param int &$queued_messages [optional] <p>
* Number of messages that are still in the queue
* </p>
* @return array|false On success, returns an associative array for the message, false on failure.
*/
#[Pure]
function curl_multi_info_read ($multi_handle, &$queued_messages = null) {}
function curl_multi_info_read (#[LanguageLevelTypeAware(["8.0" => "CurlMultiHandle"], default: "resource")] $multi_handle, &$queued_messages) {}
/**
* Close a set of cURL handles
* @link https://php.net/manual/en/function.curl-multi-close.php
* @param resource $multi_handle
* @param CurlMultiHandle|resource $multi_handle
* @return void
*/
function curl_multi_close ($multi_handle) {}
function curl_multi_close (#[LanguageLevelTypeAware(["8.0" => "CurlMultiHandle"], default: "resource")] $multi_handle) {}
/**
* Return the last multi curl error number
* @param resource $multi_handle
* @param CurlMultiHandle|resource $multi_handle
* @return int
* @since 7.1
*/
#[Pure]
function curl_multi_errno($multi_handle) {}
function curl_multi_errno(#[LanguageLevelTypeAware(["8.0" => "CurlMultiHandle"], default: "resource")] $multi_handle) {}
/**
* Return the last share curl error number
* @param resource $share_handle
* @param CurlMultiHandle|resource $share_handle
* @return int
* @since 7.1
*/
#[Pure]
function curl_share_errno($share_handle) {}
function curl_share_errno(#[LanguageLevelTypeAware(["8.0" => "CurlShareHandle"], default: "resource")] $share_handle) {}
/**
* Return string describing the given error code

View File

@ -144,7 +144,7 @@ function hash_init (string $algo, int $flags = 0, string $key)
* </p>
* @return bool <b>TRUE</b>.
*/
function hash_update ($context, string $data){}
function hash_update (#[LanguageLevelTypeAware(["8.0" => "HashContext"], default: "resource")] $context, string $data){}
/**
* (PHP 5 &gt;= 5.1.2, PECL hash &gt;= 1.1)<br/>
@ -162,14 +162,14 @@ function hash_update ($context, string $data){}
* </p>
* @return int Actual number of bytes added to the hashing context from <i>handle</i>.
*/
function hash_update_stream ($context, $stream, int $length = -1)
function hash_update_stream (#[LanguageLevelTypeAware(["8.0" => "HashContext"], default: "resource")] $context, $stream, int $length = -1)
{}
/**
* (PHP 5 &gt;= 5.1.2, PECL hash &gt;= 1.1)<br/>
* Pump data into an active hashing context from a file
* @link https://php.net/manual/en/function.hash-update-file.php
* @param resource $context <p>
* @param HashContext|resource $context <p>
* Hashing context returned by <b>hash_init</b>.
* </p>
* @param string $filename <p>
@ -180,7 +180,7 @@ function hash_update_stream ($context, $stream, int $length = -1)
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function hash_update_file ($context, string $filename, $stream_context = null)
function hash_update_file (#[LanguageLevelTypeAware(["8.0" => "HashContext"], default: "resource")] $context, string $filename, $stream_context)
{}
/**
@ -198,7 +198,7 @@ function hash_update_file ($context, string $filename, $stream_context = null)
* unless <i>raw_output</i> is set to true in which case the raw
* binary representation of the message digest is returned.
*/
function hash_final ($context, bool $binary = false)
function hash_final (#[LanguageLevelTypeAware(["8.0" => "HashContext"], default: "resource")] $context, bool $binary = false)
{}
/**
@ -210,7 +210,7 @@ function hash_final ($context, bool $binary = false)
* @return HashContext|resource a copy of Hashing Context resource.
*/
#[Pure]
function hash_copy ($context) {}
function hash_copy (#[LanguageLevelTypeAware(["8.0" => "HashContext"], default: "resource")] $context) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL hash &gt;= 1.1)<br/>

View File

@ -6,13 +6,13 @@ use JetBrains\PhpStorm\Deprecated;
/**
* Frees a private key
* @link https://php.net/manual/en/function.openssl-pkey-free.php
* @param resource $key <p>
* @param OpenSSLAsymmetricKey|resource $key <p>
* Resource holding the key.
* </p>
* @return void
*/
#[Deprecated(since: '8.0')]
function openssl_pkey_free($key) { }
function openssl_pkey_free(#[LanguageLevelTypeAware(["8.0" => "OpenSSLAsymmetricKey"], default: "resource")] $key) { }
/**
* Generates a new private key
@ -26,7 +26,7 @@ function openssl_pkey_free($key) { }
* @return resource|false a resource identifier for the pkey on success, or false on
* error.
*/
function openssl_pkey_new(array $options = null) { }
function openssl_pkey_new(array $options) { }
/**
* Gets an exportable representation of a key into a string
@ -44,7 +44,7 @@ function openssl_pkey_new(array $options = null) { }
* </p>
* @return bool true on success or false on failure.
*/
function openssl_pkey_export($key, &$output, $passphrase = null, array $options = null) { }
function openssl_pkey_export($key, &$output, string $passphrase, array $options) { }
/**
* Gets an exportable representation of a key into a file
@ -65,7 +65,7 @@ function openssl_pkey_export($key, &$output, $passphrase = null, array $options
* </p>
* @return bool true on success or false on failure.
*/
function openssl_pkey_export_to_file($key, $output_filename, $passphrase = null, array $options = null) { }
function openssl_pkey_export_to_file($key, string $output_filename, string $passphrase, array $options) { }
/**
* Get a private key
@ -86,7 +86,7 @@ function openssl_pkey_export_to_file($key, $output_filename, $passphrase = null,
* </p>
* @return resource|false Returns a positive key resource identifier on success, or <b>FALSE</b> on error.
*/
function openssl_pkey_get_private($private_key, $passphrase = "") { }
function openssl_pkey_get_private($private_key, string $passphrase = "") { }
/**
* Extract public key from certificate and prepare it for use
@ -108,7 +108,7 @@ function openssl_pkey_get_public($public_key) { }
/**
* Returns an array with the key details
* @link https://php.net/manual/en/function.openssl-pkey-get-details.php
* @param resource $key <p>
* @param OpenSSLAsymmetricKey|resource $key <p>
* Resource holding the key.
* </p>
* @return array|false an array with the key details in success or false in failure.
@ -124,16 +124,16 @@ function openssl_pkey_get_public($public_key) { }
* Depending on the key type used, additional details may be returned. Note that
* some elements may not always be available.
*/
function openssl_pkey_get_details($key) { }
function openssl_pkey_get_details(#[LanguageLevelTypeAware(["8.0" => "OpenSSLAsymmetricKey"], default: "resource")] $key) { }
/**
* Free key resource
* @link https://php.net/manual/en/function.openssl-free-key.php
* @param resource $key
* @param OpenSSLAsymmetricKey|resource $key
* @return void
*/
#[Deprecated(since: '8.0')]
function openssl_free_key($key) { }
function openssl_free_key(#[LanguageLevelTypeAware(["8.0" => "OpenSSLAsymmetricKey"], default: "resource")] $key) { }
/**
* Alias of <b>openssl_pkey_get_private</b>
@ -154,7 +154,7 @@ function openssl_free_key($key) { }
* </p>
* @return resource|false Returns a positive key resource identifier on success, or <b>FALSE</b> on error.
*/
function openssl_get_privatekey($private_key, $passphrase) { }
function openssl_get_privatekey($private_key, string $passphrase) { }
/**
* Alias of <b>openssl_pkey_get_public</b>
@ -177,7 +177,7 @@ function openssl_get_publickey($public_key) { }
/**
* Generate a new signed public key and challenge
* @link https://php.net/manual/en/function.openssl-spki-new.php
* @param resource &$private_key <p>
* @param OpenSSLAsymmetricKey|resource &$private_key <p>
* <b>privkey</b> should be set to a private key that was
* previously generated by {@link https://php.net/en/manual/function.openssl-pkey-new.php openssl_pkey_new()} (or
* otherwise obtained from the other openssl_pkey family of functions).
@ -189,7 +189,7 @@ function openssl_get_publickey($public_key) { }
* @return string|null Returns a signed public key and challenge string or NULL on failure.
* @since 5.6
*/
function openssl_spki_new(&$private_key, &$challenge, $digest_algo = 0) {}
function openssl_spki_new(#[LanguageLevelTypeAware(["8.0" => "OpenSSLAsymmetricKey"], default: "resource")] &$private_key, string &$challenge, int $digest_algo = 0) {}
/**
@ -199,7 +199,7 @@ function openssl_spki_new(&$private_key, &$challenge, $digest_algo = 0) {}
* @return bool Returns a boolean on success or failure.
* @since 5.6
*/
function openssl_spki_verify(&$spki) {}
function openssl_spki_verify(string &$spki) {}
/**
* Exports the challenge associated with a signed public key and challenge
@ -208,7 +208,7 @@ function openssl_spki_verify(&$spki) {}
* @return string|null Returns the associated challenge string or NULL on failure.
* @since 5.6
*/
function openssl_spki_export_challenge (&$spki ) {}
function openssl_spki_export_challenge (string &$spki) {}
/**
* Exports a valid PEM formatted public key signed public key and challenge
@ -217,15 +217,15 @@ function openssl_spki_export_challenge (&$spki ) {}
* @return string|null Returns the associated PEM formatted public key or NULL on failure.
* @since 5.6
*/
function openssl_spki_export (&$spki ) {}
function openssl_spki_export (string &$spki ) {}
/**
* Parse an X.509 certificate and return a resource identifier for
* it
* @link https://php.net/manual/en/function.openssl-x509-read.php
* @param mixed $certificate
* @param OpenSSLCertificate|string|resource $certificate
* @return resource|false a resource identifier on success or false on failure.
*/
function openssl_x509_read($certificate) { }
function openssl_x509_read(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate) { }
/**
* @param string $certificate
@ -234,20 +234,20 @@ function openssl_x509_read($certificate) { }
* @return string|false <b>FALSE</b> on failure
* @since 5.6
*/
function openssl_x509_fingerprint($certificate, $digest_algo, $binary) {}
function openssl_x509_fingerprint(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, string $digest_algo, bool $binary) {}
/**
* Free certificate resource
* @link https://php.net/manual/en/function.openssl-x509-free.php
* @param resource $certificate
* @param OpenSSLCertificate $certificateopenssl_x509_parse
* @return void
*/
#[Deprecated(since: '8.0')]
function openssl_x509_free($certificate) { }
function openssl_x509_free(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate"], default: "resource|string")] $certificate) { }
/**
* Parse an X509 certificate and return the information as an array
* @link https://php.net/manual/en/function.openssl-x509-parse.php
* @param mixed $certificate
* @param OpenSSLCertificate|string|resource $certificate
* @param bool $short_names [optional] <p>
* <i>shortnames</i> controls how the data is indexed in the
* array - if <i>shortnames</i> is true (the default) then
@ -257,12 +257,12 @@ function openssl_x509_free($certificate) { }
* @return array|false The structure of the returned data is (deliberately) not
* yet documented, as it is still subject to change.
*/
function openssl_x509_parse(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, $short_names = true) { }
function openssl_x509_parse(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, bool $short_names = true) { }
/**
* Verifies if a certificate can be used for a particular purpose
* @link https://php.net/manual/en/function.openssl-x509-checkpurpose.php
* @param mixed $certificate <p>
* @param OpenSSLCertificate|string|resource $certificate <p>
* The examined certificate.
* </p>
* @param int $purpose <p>
@ -319,12 +319,12 @@ function openssl_x509_parse(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertifica
* @return int|bool true if the certificate can be used for the intended purpose,
* false if it cannot, or -1 on error.
*/
function openssl_x509_checkpurpose(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, $purpose, array $ca_info = null, $untrusted_certificates_file = null) { }
function openssl_x509_checkpurpose(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, int $purpose, array $ca_info, string $untrusted_certificates_file) { }
/**
* Checks if a private key corresponds to a certificate
* @link https://php.net/manual/en/function.openssl-x509-check-private-key.php
* @param mixed $certificate <p>
* @param OpenSSLCertificate|string|resource $certificate <p>
* The certificate.
* </p>
* @param mixed $private_key <p>
@ -345,7 +345,7 @@ function openssl_x509_check_private_key(#[LanguageLevelTypeAware(["8.0" => "Open
* @param bool $no_text [optional] &note.openssl.param-notext;
* @return bool true on success or false on failure.
*/
function openssl_x509_export(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, &$output, $no_text = true) { }
function openssl_x509_export(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, &$output, bool $no_text = true) { }
/**
* Exports a certificate to file
@ -357,22 +357,22 @@ function openssl_x509_export(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertific
* @param bool $no_text [optional] &note.openssl.param-notext;
* @return bool true on success or false on failure.
*/
function openssl_x509_export_to_file(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, $output_filename, $no_text = true) { }
function openssl_x509_export_to_file(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, string $output_filename, bool $no_text = true) { }
/**
* Verifies digital signature of x509 certificate against a public key
* @link https://www.php.net/manual/en/function.openssl-x509-verify.php
* @param mixed $x509
* @param OpenSSLCertificate|string|resource $certificate
* @param mixed $public_key
* @return int Returns 1 if the signature is correct, 0 if it is incorrect, and -1 on error.
* @since 7.4
*/
function openssl_x509_verify($certificate, $public_key) : int {}
function openssl_x509_verify(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, $public_key) : int {}
/**
* Exports a PKCS#12 Compatible Certificate Store File to variable.
* @link https://php.net/manual/en/function.openssl-pkcs12-export.php
* @param mixed $certificate
* @param OpenSSLCertificate|string|resource $certificate
* @param string &$output <p>
* On success, this will hold the PKCS#12.
* </p>
@ -386,12 +386,12 @@ function openssl_x509_verify($certificate, $public_key) : int {}
* @return bool true on success or false on failure.
* @since 5.2.2
*/
function openssl_pkcs12_export($certificate, &$output, $private_key, $passphrase, array $options = null) { }
function openssl_pkcs12_export(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, &$output, $private_key, string $passphrase, array $options) { }
/**
* Exports a PKCS#12 Compatible Certificate Store File
* @link https://php.net/manual/en/function.openssl-pkcs12-export-to-file.php
* @param mixed $certificate
* @param OpenSSLCertificate|string|resource $certificate
* @param string $output_filename <p>
* Path to the output file.
* </p>
@ -405,7 +405,7 @@ function openssl_pkcs12_export($certificate, &$output, $private_key, $passphrase
* @return bool true on success or false on failure.
* @since 5.2.2
*/
function openssl_pkcs12_export_to_file($certificate, $output_filename, $private_key, $passphrase, array $options = null) { }
function openssl_pkcs12_export_to_file(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, string $output_filename, $private_key, string $passphrase, array $options) { }
/**
* Parse a PKCS#12 Certificate Store into an array
@ -420,7 +420,7 @@ function openssl_pkcs12_export_to_file($certificate, $output_filename, $private_
* @return bool true on success or false on failure.
* @since 5.2.2
*/
function openssl_pkcs12_read($pkcs12, array &$certificates, $passphrase) { }
function openssl_pkcs12_read(string $pkcs12, &$certificates, string $passphrase) { }
/**
* Generates a CSR
@ -515,40 +515,40 @@ function openssl_pkcs12_read($pkcs12, array &$certificates, $passphrase) { }
* </p>
* @return false|resource the CSR.
*/
function openssl_csr_new(array $distinguished_names, &$private_key, array $options = null, array $extra_attributes = null) { }
function openssl_csr_new(array $distinguished_names, &$private_key, array $options, array $extra_attributes) { }
/**
* Exports a CSR as a string
* @link https://php.net/manual/en/function.openssl-csr-export.php
* @param resource $csr
* @param OpenSSLCertificateSigningRequest|string|resource $csr
* @param string &$output
* @param bool $no_text [optional] &note.openssl.param-notext;
* @return bool true on success or false on failure.
*/
function openssl_csr_export($csr, &$output, $no_text = true) { }
function openssl_csr_export(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificateSigningRequest|string"], default: "resource|string")] $csr, &$output, bool $no_text = true) { }
/**
* Exports a CSR to a file
* @link https://php.net/manual/en/function.openssl-csr-export-to-file.php
* @param resource $csr
* @param OpenSSLCertificateSigningRequest|string|resource $csr
* @param string $output_filename <p>
* Path to the output file.
* </p>
* @param bool $no_text [optional] &note.openssl.param-notext;
* @return bool true on success or false on failure.
*/
function openssl_csr_export_to_file($csr, $output_filename, $no_text = true) { }
function openssl_csr_export_to_file(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificateSigningRequest|string"], default: "resource|string")] $csr, string $output_filename, bool $no_text = true) { }
/**
* Sign a CSR with another certificate (or itself) and generate a certificate
* @link https://php.net/manual/en/function.openssl-csr-sign.php
* @param mixed $csr <p>
* @param OpenSSLCertificateSigningRequest|string|resource $csr <p>
* A CSR previously generated by <b>openssl_csr_new</b>.
* It can also be the path to a PEM encoded CSR when specified as
* file://path/to/csr or an exported string generated
* by <b>openssl_csr_export</b>.
* </p>
* @param mixed $ca_certificate <p>
* @param OpenSSLCertificate|resource|string|null $ca_certificate <p>
* The generated certificate will be signed by <i>cacert</i>.
* If <i>cacert</i> is null, the generated certificate
* will be a self-signed certificate.
@ -572,25 +572,25 @@ function openssl_csr_export_to_file($csr, $output_filename, $no_text = true) { }
* </p>
* @return resource|false an x509 certificate resource on success, false on failure.
*/
function openssl_csr_sign($csr, $ca_certificate, $private_key, $days, array $options = null, $serial = 0) { }
function openssl_csr_sign(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificateSigningRequest|string"], default: "resource|string")] $csr, #[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string|null"], default: "resource|string|null")] $ca_certificate, $private_key, int $days, array $options, int $serial = 0) { }
/**
* Returns the subject of a CERT
* @link https://php.net/manual/en/function.openssl-csr-get-subject.php
* @param mixed $csr
* @param OpenSSLCertificateSigningRequest|string|resource $csr
* @param bool $short_names [optional]
* @return array|false
*/
function openssl_csr_get_subject($csr, $short_names = true) { }
function openssl_csr_get_subject(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificateSigningRequest|string"], default: "resource|string")] $csr, bool $short_names = true) { }
/**
* Returns the public key of a CERT
* @link https://php.net/manual/en/function.openssl-csr-get-public-key.php
* @param mixed $csr
* @param OpenSSLCertificateSigningRequest|string|resource $csr
* @param bool $short_names [optional]
* @return resource|false
*/
function openssl_csr_get_public_key($csr, $short_names = true) { }
function openssl_csr_get_public_key(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificateSigningRequest|string"], default: "resource|string")] $csr, bool $short_names = true) { }
/**
* Computes a digest
@ -607,7 +607,7 @@ function openssl_csr_get_public_key($csr, $short_names = true) { }
* </p>
* @return string|false the digested hash value on success or false on failure.
*/
function openssl_digest($data, $digest_algo, $binary = false) { }
function openssl_digest(string $data, string $digest_algo, bool $binary = false) { }
/**
* Encrypts data
@ -627,14 +627,14 @@ function openssl_digest($data, $digest_algo, $binary = false) { }
* @param string $iv [optional] <p>
* A non-NULL Initialization Vector.
* </p>
* @param string &$tag <p>The authentication tag passed by reference when using AEAD cipher mode (GCM or CCM).</p>
* @param string $aad <p>Additional authentication data.</p>
* @param string &$tag [optional] <p>The authentication tag passed by reference when using AEAD cipher mode (GCM or CCM).</p>
* @param string $aad [optional] <p>Additional authentication data.</p>
* @param int $tag_length [optional] <p>
* The length of the authentication tag. Its value can be between 4 and 16 for GCM mode.
* </p>
* @return string|false the encrypted string on success or false on failure.
*/
function openssl_encrypt($data, $cipher_algo, $passphrase, $options = 0, $iv = "", &$tag = null, $aad = "", $tag_length = 16) { }
function openssl_encrypt(string $data, string $cipher_algo, string $passphrase, int $options = 0, string $iv = "", &$tag, string $aad = "", int $tag_length = 16) { }
/**
* Decrypts data
@ -662,7 +662,7 @@ function openssl_encrypt($data, $cipher_algo, $passphrase, $options = 0, $iv = "
* @param string $aad [optional] <p>Additional authentication data.</p>
* @return string|false The decrypted string on success or false on failure.
*/
function openssl_decrypt($data, $cipher_algo, $passphrase, $options = 0, $iv = "", $tag = "", $aad = "") { }
function openssl_decrypt(string $data, string $cipher_algo, string $passphrase, int $options = 0, string $iv = "", string $tag = "", string $aad = "") { }
/**
* (PHP 5 &gt;= PHP 5.3.3)<br/>
@ -673,7 +673,7 @@ function openssl_decrypt($data, $cipher_algo, $passphrase, $options = 0, $iv = "
* </p>
* @return int|false the cipher length on success, or false on failure.
*/
function openssl_cipher_iv_length($cipher_algo) { }
function openssl_cipher_iv_length(string $cipher_algo) { }
/**
* Generate signature
@ -684,12 +684,12 @@ function openssl_cipher_iv_length($cipher_algo) { }
* <i>signature</i>.
* </p>
* @param mixed $private_key
* @param int $algorithm [optional] <p>
* @param string|int $algorithm [optional] <p>
* For more information see the list of Signature Algorithms.
* </p>
* @return bool true on success or false on failure.
*/
function openssl_sign($data, &$signature, $private_key, $algorithm = OPENSSL_ALGO_SHA1) { }
function openssl_sign(string $data, &$signature, $private_key, string|int $algorithm = OPENSSL_ALGO_SHA1) { }
/**
* Verify signature
@ -697,13 +697,13 @@ function openssl_sign($data, &$signature, $private_key, $algorithm = OPENSSL_ALG
* @param string $data
* @param string $signature
* @param mixed $public_key
* @param int $algorithm [optional] <p>
* @param string|int $algorithm [optional] <p>
* For more information see the list of Signature Algorithms.
* </p>
* @return int 1 if the signature is correct, 0 if it is incorrect, and
* -1 on error.
*/
function openssl_verify($data, $signature, $public_key, $algorithm = OPENSSL_ALGO_SHA1) { }
function openssl_verify(string $data, string $signature, $public_key, string|int $algorithm = OPENSSL_ALGO_SHA1) { }
/**
* Seal (encrypt) data
@ -719,7 +719,7 @@ function openssl_verify($data, $signature, $public_key, $algorithm = OPENSSL_ALG
* <i>sealed_data</i>, and the envelope keys in
* <i>env_keys</i>.
*/
function openssl_seal($data, &$sealed_data, array &$encrypted_keys, array $public_key, $cipher_algo = null, &$iv = '') { }
function openssl_seal(string $data, &$sealed_data, &$encrypted_keys, array $public_key, string $cipher_algo, &$iv = '') { }
/**
* Open sealed data
@ -735,7 +735,7 @@ function openssl_seal($data, &$sealed_data, array &$encrypted_keys, array $publi
* @param string $iv [optional] The initialization vector.
* @return bool true on success or false on failure.
*/
function openssl_open($data, &$output, $encrypted_key, $private_key, $cipher_algo = "RC4", string $iv) { }
function openssl_open(string $data, &$output, string $encrypted_key, $private_key, string $cipher_algo = "RC4", string $iv) { }
/**
* Generates a PKCS5 v2 PBKDF2 string, defaults to SHA-1
@ -748,7 +748,7 @@ function openssl_open($data, &$output, $encrypted_key, $private_key, $cipher_alg
* @return string|false Returns string or FALSE on failure.
* @since 5.5
*/
function openssl_pbkdf2($password, $salt, $key_length, $iterations, $digest_algo) { }
function openssl_pbkdf2(string $password, string $salt, int $key_length, int $iterations, string $digest_algo) { }
/**
* Verifies the signature of an S/MIME signed message
@ -786,7 +786,7 @@ function openssl_pbkdf2($password, $salt, $key_length, $iterations, $digest_algo
* (the message has been tampered with, or the signing certificate is invalid),
* or -1 on error.
*/
function openssl_pkcs7_verify($input_filename, $flags, $signers_certificates_filename = null, array $ca_info = null, $untrusted_certificates_filename = null, $content = null, $output_filename = null) { }
function openssl_pkcs7_verify(string $input_filename, int $flags, string $signers_certificates_filename, array $ca_info, string $untrusted_certificates_filename, string $content, string $output_filename) { }
/**
* Decrypts an S/MIME encrypted message
@ -796,18 +796,18 @@ function openssl_pkcs7_verify($input_filename, $flags, $signers_certificates_fil
* The decrypted message is written to the file specified by
* <i>outfilename</i>.
* </p>
* @param mixed $certificate
* @param OpenSSLCertificate|string|resource $certificate
* @param mixed $private_key [optional]
* @return bool true on success or false on failure.
*/
function openssl_pkcs7_decrypt($input_filename, $output_filename, $certificate, $private_key = null) { }
function openssl_pkcs7_decrypt(string $input_filename, string $output_filename, $certificate, $private_key) { }
/**
* Sign an S/MIME message
* @link https://php.net/manual/en/function.openssl-pkcs7-sign.php
* @param string $input_filename
* @param string $output_filename
* @param mixed $certificate
* @param OpenSSLCertificate|string|resource $certificate
* @param mixed $private_key
* @param array $headers <p>
* <i>headers</i> is an array of headers that
@ -825,14 +825,14 @@ function openssl_pkcs7_decrypt($input_filename, $output_filename, $certificate,
* </p>
* @return bool true on success or false on failure.
*/
function openssl_pkcs7_sign($input_filename, $output_filename, $certificate, $private_key, array $headers, $flags = PKCS7_DETACHED, $untrusted_certificates_filename = null) { }
function openssl_pkcs7_sign(string $input_filename, string $output_filename, #[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, $private_key, array $headers, int $flags = PKCS7_DETACHED, string $untrusted_certificates_filename) { }
/**
* Encrypt an S/MIME message
* @link https://php.net/manual/en/function.openssl-pkcs7-encrypt.php
* @param string $input_filename
* @param string $output_filename
* @param mixed $certificate <p>
* @param OpenSSLCertificate|string|resource $certificate <p>
* Either a lone X.509 certificate, or an array of X.509 certificates.
* </p>
* @param array $headers <p>
@ -854,7 +854,7 @@ function openssl_pkcs7_sign($input_filename, $output_filename, $certificate, $pr
* </p>
* @return bool true on success or false on failure.
*/
function openssl_pkcs7_encrypt($input_filename, $output_filename, $certificate, array $headers, $flags = 0, $cipher_algo = OPENSSL_CIPHER_RC2_40) { }
function openssl_pkcs7_encrypt(string $input_filename, string $output_filename, $certificate, array $headers, int $flags = 0, int $cipher_algo = OPENSSL_CIPHER_RC2_40) { }
/**
* Encrypts data with private key
@ -869,7 +869,7 @@ function openssl_pkcs7_encrypt($input_filename, $output_filename, $certificate,
* </p>
* @return bool true on success or false on failure.
*/
function openssl_private_encrypt($data, &$encrypted_data, $private_key, $padding = OPENSSL_PKCS1_PADDING) { }
function openssl_private_encrypt(string $data, &$encrypted_data, $private_key, int $padding = OPENSSL_PKCS1_PADDING) { }
/**
* Decrypts data with private key
@ -889,7 +889,7 @@ function openssl_private_encrypt($data, &$encrypted_data, $private_key, $padding
* </p>
* @return bool true on success or false on failure.
*/
function openssl_private_decrypt($data, &$decrypted_data, $private_key, $padding = OPENSSL_PKCS1_PADDING) { }
function openssl_private_decrypt(string $data, &$decrypted_data, $private_key, int $padding = OPENSSL_PKCS1_PADDING) { }
/**
* Encrypts data with public key
@ -910,7 +910,7 @@ function openssl_private_decrypt($data, &$decrypted_data, $private_key, $padding
* </p>
* @return bool true on success or false on failure.
*/
function openssl_public_encrypt($data, &$encrypted_data, $public_key, $padding = OPENSSL_PKCS1_PADDING) { }
function openssl_public_encrypt(string $data, &$encrypted_data, $public_key, int $padding = OPENSSL_PKCS1_PADDING) { }
/**
* Decrypts data with public key
@ -928,7 +928,7 @@ function openssl_public_encrypt($data, &$encrypted_data, $public_key, $padding =
* </p>
* @return bool true on success or false on failure.
*/
function openssl_public_decrypt($data, &$decrypted_data, $public_key, $padding = OPENSSL_PKCS1_PADDING) { }
function openssl_public_decrypt(string $data, &$decrypted_data, $public_key, int $padding = OPENSSL_PKCS1_PADDING) { }
/**
* Gets available digest methods
@ -939,7 +939,7 @@ function openssl_public_decrypt($data, &$decrypted_data, $public_key, $padding =
* </p>
* @return array An array of available digest methods.
*/
function openssl_get_md_methods($aliases = false) { }
function openssl_get_md_methods(bool $aliases = false) { }
/**
* Gets available cipher methods
@ -950,7 +950,7 @@ function openssl_get_md_methods($aliases = false) { }
* </p>
* @return array An array of available cipher methods.
*/
function openssl_get_cipher_methods($aliases = false) { }
function openssl_get_cipher_methods(bool $aliases = false) { }
/**
* (No version information available, might only be in SVN)<br/>
@ -959,12 +959,12 @@ function openssl_get_cipher_methods($aliases = false) { }
* @param string $public_key <p>
* Public key
* </p>
* @param resource $private_key <p>
* @param OpenSSLAsymmetricKey|resource $private_key <p>
* DH key
* </p>
* @return string|false computed key on success or false on failure.
*/
function openssl_dh_compute_key($public_key, $private_key) { }
function openssl_dh_compute_key(string $public_key, #[LanguageLevelTypeAware(["8.0" => "OpenSSLAsymmetricKey"], default: "resource")] $private_key) { }
/**
* @param $public_key
@ -972,7 +972,7 @@ function openssl_dh_compute_key($public_key, $private_key) { }
* @param $key_length
* @since 7.3
*/
function openssl_pkey_derive($public_key, $private_key, $key_length) {}
function openssl_pkey_derive($public_key, $private_key, int $key_length) {}
/**
* Generates a string of pseudo-random bytes, with the number of bytes determined by the length parameter.
@ -990,7 +990,7 @@ function openssl_pkey_derive($public_key, $private_key, $key_length) {}
* </p>
* @return string|false the generated string of bytes on success, or false on failure.
*/
function openssl_random_pseudo_bytes($length, &$strong_result = null) { }
function openssl_random_pseudo_bytes(int $length, &$strong_result) { }
/**
* Return openSSL error message
@ -1016,13 +1016,23 @@ function openssl_get_curve_names() {}
* @return bool
* @since 7.2
*/
function openssl_pkcs7_read($input_filename, &$certificates) {}
function openssl_pkcs7_read(string $input_filename, &$certificates) {}
/**
* Verifies that the data block is intact, the signer is who they say they are, and returns the certs of the signers.
* @param string $input_filename
* @param int $flags [optional]
* @param string $certificates [optional]
* @param array $ca_info [optional]
* @param string $untrusted_certificates_filename [optional]
* @param string $content [optional]
* @param string $pk7 [optional]
* @param string $sigfile [optional]
* @param int $encoding [optional]
* @return bool
* @since 8.0
*/
function openssl_cms_verify(string $input_filename, int $flags = 0, ?string $certificates = null, ?array $ca_info = null, ?string $untrusted_certificates_filename = null, ?string $content = null, ?string $pk7 = null, ?string $sigfile = null, $encoding = OPENSSL_ENCODING_SMIME): bool {}
function openssl_cms_verify(string $input_filename, int $flags = 0, string $certificates, array $ca_info, string $untrusted_certificates_filename, string $content, string $pk7, string $sigfile, int $encoding = OPENSSL_ENCODING_SMIME): bool {}
/**
* Encrypts the message in the file with the certificates and outputs the result to the supplied file.
@ -1033,11 +1043,18 @@ function openssl_cms_encrypt(string $input_filename, string $output_filename, $c
/**
* Signs the MIME message in the file with a cert and key and output the result to the supplied file.
* @param resource|string $certificate
* @param resource|string|array $signkey8
* @param string $input_filename
* @param string $output_filename
* @param OpenSSLCertificate|string $certificate
* @param $private_key
* @param array|null $headers
* @param int $flags [optional]
* @param int $encoding [optional]
* @param string $untrusted_certificates_filename [optional]
* @return bool
* @since 8.0
*/
function openssl_cms_sign(string $input_filename, string $output_filename, $certificate, $private_key, ?array $headers, int $flags = 0, int $encoding = OPENSSL_ENCODING_SMIME, ?string $untrusted_certificates_filename = null): bool {}
function openssl_cms_sign(string $input_filename, string $output_filename, OpenSSLCertificate|string $certificate, $private_key, ?array $headers, int $flags = 0, int $encoding = OPENSSL_ENCODING_SMIME, string $untrusted_certificates_filename): bool {}
/**
* Decrypts the S/MIME message in the file and outputs the results to the supplied file.

View File

@ -32,7 +32,7 @@ function shmop_open (int $key, string $mode, int $permissions, int $size) {}
/**
* Read data from shared memory block
* @link https://php.net/manual/en/function.shmop-read.php
* @param resource $shmop <p>
* @param Shmop|resource $shmop <p>
* The shared memory block identifier created by
* <b>shmop_open</b>
* </p>
@ -44,36 +44,36 @@ function shmop_open (int $key, string $mode, int $permissions, int $size) {}
* </p>
* @return string|false the data or <b>FALSE</b> on failure.
*/
function shmop_read ($shmop, $offset, $size) {}
function shmop_read (#[LanguageLevelTypeAware(["8.0" => "Shmop"], default: "resource")] $shmop, int $offset, int $size) {}
/**
* Close shared memory block
* @link https://php.net/manual/en/function.shmop-close.php
* @param resource $shmop <p>
* @param Shmop|resource $shmop <p>
* The shared memory block identifier created by
* <b>shmop_open</b>
* </p>
* @return void No value is returned.
*/
#[Deprecated(since: '8.0')]
function shmop_close ($shmop) {}
function shmop_close (#[LanguageLevelTypeAware(["8.0" => "Shmop"], default: "resource")] $shmop) {}
/**
* Get size of shared memory block
* @link https://php.net/manual/en/function.shmop-size.php
* @param resource $shmop <p>
* @param Shmop|resource $shmop <p>
* The shared memory block identifier created by
* <b>shmop_open</b>
* </p>
* @return int an int, which represents the number of bytes the shared memory
* block occupies.
*/
function shmop_size ($shmop) {}
function shmop_size (#[LanguageLevelTypeAware(["8.0" => "Shmop"], default: "resource")] $shmop) {}
/**
* Write data into shared memory block
* @link https://php.net/manual/en/function.shmop-write.php
* @param resource $shmop <p>
* @param Shmop|resource $shmop <p>
* The shared memory block identifier created by
* <b>shmop_open</b>
* </p>
@ -87,18 +87,18 @@ function shmop_size ($shmop) {}
* @return int|false The size of the written <i>data</i>, or <b>FALSE</b> on
* failure.
*/
function shmop_write ($shmop, $data, $offset) {}
function shmop_write (#[LanguageLevelTypeAware(["8.0" => "Shmop"], default: "resource")] $shmop, string $data, int $offset) {}
/**
* Delete shared memory block
* @link https://php.net/manual/en/function.shmop-delete.php
* @param resource $shmop <p>
* @param Shmop|resource $shmop <p>
* The shared memory block identifier created by
* <b>shmop_open</b>
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function shmop_delete ($shmop) {}
function shmop_delete (#[LanguageLevelTypeAware(["8.0" => "Shmop"], default: "resource")] $shmop) {}
/**
* @since 8.0

View File

@ -19,7 +19,7 @@ function msg_get_queue (int $key, int $permissions = 0666) {}
/**
* Send a message to a message queue
* @link https://php.net/manual/en/function.msg-send.php
* @param resource $queue
* @param SysvMessageQueue|resource $queue
* @param int $message_type
* @param mixed $message
* @param bool $serialize [optional] <p>
@ -52,12 +52,12 @@ function msg_get_queue (int $key, int $permissions = 0666) {}
* calling process, <i>msg_qnum</i> is incremented by 1 and
* <i>msg_stime</i> is set to the current time.
*/
function msg_send ($queue, $message_type, $message, $serialize = true, $blocking = true, &$error_code = null) {}
function msg_send (#[LanguageLevelTypeAware(["8.0" => "SysvMessageQueue"], default: "resource")] $queue, int $message_type, $message, bool $serialize = true, bool $blocking = true, &$error_code) {}
/**
* Receive a message from a message queue
* @link https://php.net/manual/en/function.msg-receive.php
* @param resource $queue
* @param SysvMessageQueue|resource $queue
* @param int $desired_message_type <p>
* If <i>desiredmsgtype</i> is 0, the message from the front
* of the queue is returned. If <i>desiredmsgtype</i> is
@ -139,22 +139,22 @@ function msg_send ($queue, $message_type, $message, $serialize = true, $blocking
* calling process, msg_qnum is decremented by 1 and
* msg_rtime is set to the current time.
*/
function msg_receive ($queue, $desired_message_type, &$received_message_type, $max_message_size, &$message, $unserialize = true, $flags = 0, &$error_code = null) {}
function msg_receive (#[LanguageLevelTypeAware(["8.0" => "SysvMessageQueue"], default: "resource")] $queue, int $desired_message_type, &$received_message_type, int $max_message_size, mixed &$message, bool $unserialize = true, int $flags = 0, &$error_code) {}
/**
* Destroy a message queue
* @link https://php.net/manual/en/function.msg-remove-queue.php
* @param resource $queue <p>
* @param SysvMessageQueue|resource $queue <p>
* Message queue resource handle
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function msg_remove_queue ($queue) {}
function msg_remove_queue (#[LanguageLevelTypeAware(["8.0" => "SysvMessageQueue"], default: "resource")] $queue) {}
/**
* Returns information from the message queue data structure
* @link https://php.net/manual/en/function.msg-stat-queue.php
* @param resource $queue <p>
* @param SysvMessageQueue|resource $queue <p>
* Message queue resource handle
* </p>
* @return array The return value is an array whose keys and values have the following
@ -225,12 +225,12 @@ function msg_remove_queue ($queue) {}
* </tr>
* </table>
*/
function msg_stat_queue ($queue) {}
function msg_stat_queue (#[LanguageLevelTypeAware(["8.0" => "SysvMessageQueue"], default: "resource")] $queue) {}
/**
* Set information in the message queue data structure
* @link https://php.net/manual/en/function.msg-set-queue.php
* @param resource $queue <p>
* @param SysvMessageQueue|resource $queue <p>
* Message queue resource handle
* </p>
* @param array $data <p>
@ -239,7 +239,7 @@ function msg_stat_queue ($queue) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function msg_set_queue ($queue, array $data) {}
function msg_set_queue (#[LanguageLevelTypeAware(["8.0" => "SysvMessageQueue"], default: "resource")] $queue, array $data) {}
/**
* Check whether a message queue exists

View File

@ -27,7 +27,7 @@ function sem_get (int $key, int $max_acquire = 1, int $permissions = 0666, bool
/**
* Acquire a semaphore
* @link https://php.net/manual/en/function.sem-acquire.php
* @param resource $semaphore <p>
* @param SysvSemaphore|resource $semaphore <p>
* <i>sem_identifier</i> is a semaphore resource,
* obtained from <b>sem_get</b>.
* </p>
@ -38,29 +38,29 @@ function sem_get (int $key, int $max_acquire = 1, int $permissions = 0666, bool
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function sem_acquire ($semaphore, $non_blocking = false) {}
function sem_acquire (#[LanguageLevelTypeAware(["8.0" => "SysvSemaphore"], default: "resource")] $semaphore, bool $non_blocking = false) {}
/**
* Release a semaphore
* @link https://php.net/manual/en/function.sem-release.php
* @param resource $semaphore <p>
* @param SysvSemaphore|resource $semaphore <p>
* A Semaphore resource handle as returned by
* <b>sem_get</b>.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function sem_release ($semaphore) {}
function sem_release (#[LanguageLevelTypeAware(["8.0" => "SysvSemaphore"], default: "resource")] $semaphore) {}
/**
* Remove a semaphore
* @link https://php.net/manual/en/function.sem-remove.php
* @param resource $semaphore <p>
* @param SysvSemaphore|resource $semaphore <p>
* A semaphore resource identifier as returned
* by <b>sem_get</b>.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function sem_remove ($semaphore) {}
function sem_remove (#[LanguageLevelTypeAware(["8.0" => "SysvSemaphore"], default: "resource")] $semaphore) {}
/**
* @since 8.0

View File

@ -23,29 +23,29 @@ function shm_attach (int $key, int $size, int $permissions = 0666) {}
/**
* Removes shared memory from Unix systems
* @link https://php.net/manual/en/function.shm-remove.php
* @param resource $shm <p>
* @param SysvSharedMemory $shm <p>
* The shared memory identifier as returned by
* <b>shm_attach</b>
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function shm_remove ($shm) {}
function shm_remove (#[LanguageLevelTypeAware(["8.0" => "SysvSharedMemory"], default: "resource")] $shm) {}
/**
* Disconnects from shared memory segment
* @link https://php.net/manual/en/function.shm-detach.php
* @param resource $shm <p>
* @param SysvSharedMemory $shm <p>
* A shared memory resource handle as returned by
* <b>shm_attach</b>
* </p>
* @return bool <b>shm_detach</b> always returns <b>TRUE</b>.
*/
function shm_detach ($shm) {}
function shm_detach (#[LanguageLevelTypeAware(["8.0" => "SysvSharedMemory"], default: "resource")] $shm) {}
/**
* Inserts or updates a variable in shared memory
* @link https://php.net/manual/en/function.shm-put-var.php
* @param resource $shm <p>
* @param SysvSharedMemory $shm <p>
* A shared memory resource handle as returned by
* <b>shm_attach</b>
* </p>
@ -60,12 +60,12 @@ function shm_detach ($shm) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function shm_put_var ($shm, $key, $value) {}
function shm_put_var (#[LanguageLevelTypeAware(["8.0" => "SysvSharedMemory"], default: "resource")] $shm, int $key, mixed $value) {}
/**
* Check whether a specific entry exists
* @link https://php.net/manual/en/function.shm-has-var.php
* @param resource $shm <p>
* @param SysvSharedMemory $shm <p>
* Shared memory segment, obtained from <b>shm_attach</b>.
* </p>
* @param int $key <p>
@ -73,12 +73,12 @@ function shm_put_var ($shm, $key, $value) {}
* </p>
* @return bool <b>TRUE</b> if the entry exists, otherwise <b>FALSE</b>
*/
function shm_has_var ($shm, $key) {}
function shm_has_var (#[LanguageLevelTypeAware(["8.0" => "SysvSharedMemory"], default: "resource")] $shm, int $key) {}
/**
* Returns a variable from shared memory
* @link https://php.net/manual/en/function.shm-get-var.php
* @param resource $shm <p>
* @param SysvSharedMemory $shm <p>
* Shared memory segment, obtained from <b>shm_attach</b>.
* </p>
* @param int $key <p>
@ -86,12 +86,12 @@ function shm_has_var ($shm, $key) {}
* </p>
* @return mixed the variable with the given key.
*/
function shm_get_var ($shm, $key) {}
function shm_get_var (#[LanguageLevelTypeAware(["8.0" => "SysvSharedMemory"], default: "resource")] $shm, int $key) {}
/**
* Removes a variable from shared memory
* @link https://php.net/manual/en/function.shm-remove-var.php
* @param resource $shm <p>
* @param SysvSharedMemory $shm <p>
* The shared memory identifier as returned by
* <b>shm_attach</b>
* </p>
@ -100,7 +100,7 @@ function shm_get_var ($shm, $key) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function shm_remove_var ($shm, $key) {}
function shm_remove_var (#[LanguageLevelTypeAware(["8.0" => "SysvSharedMemory"], default: "resource")] $shm, int $key) {}
/**
* @since 8.0

View File

@ -4,10 +4,12 @@ declare(strict_types=1);
namespace StubTests\Model;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\Array_;
use PhpParser\Node\Identifier;
use PhpParser\Node\Name;
use PhpParser\Node\NullableType;
use PhpParser\Node\Param;
use PhpParser\Node\Scalar\String_;
use PhpParser\Node\UnionType;
use ReflectionNamedType;
use ReflectionParameter;
@ -50,20 +52,27 @@ class PHPParameter extends BasePHPElement
{
// #[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")]
$this->name = $node->var->name;
$type = $node->type;
if ($type !== null) {
if ($type instanceof UnionType) {
foreach ($type->types as $type) {
$this->type .= $this->getTypeNameFromNode($type) . '|';
$typeFromAttribute = $this->findTypeFromAttribute($node);
if ($typeFromAttribute != null) {
$this->type = $typeFromAttribute;
} else {
$type = $node->type;
if ($type !== null) {
if ($type instanceof UnionType) {
foreach ($type->types as $type) {
$this->type .= $this->getTypeNameFromNode($type) . '|';
}
$this->type = substr($this->type, 0, -1);
} else {
$this->type = $this->getTypeNameFromNode($type);
}
$this->type = substr($this->type, 0, -1);
} else {
$this->type = $this->getTypeNameFromNode($type);
}
}
if($node->default instanceof Expr\ConstFetch && $node->default->name->parts[0] === "null"){
$this->type .= "|null";
}
$this->is_vararg = $node->variadic;
$this->is_passed_by_ref = $node->byRef;
return $this;
@ -101,4 +110,22 @@ class PHPParameter extends BasePHPElement
return $type->name;
}
}
protected function findTypeFromAttribute(Param $node): ?string
{
foreach ($node->attrGroups as $attrGroup) {
foreach ($attrGroup->attrs as $attr) {
if ($attr->name->toString() === "LanguageLevelTypeAware") {
$arg = $attr->args[0]->value;
if ($arg instanceof Array_) {
$value = $arg->items[0]->value;
if ($value instanceof String_) {
return $value->value;
}
}
}
}
}
return null;
}
}

View File

@ -474,10 +474,10 @@ class StubsTest extends TestCase
$link->getLink(),
"In $elementName @link doesn't start with https"
);
if (getenv("CHECK_LINKS") === "true"){
if ($element->stubBelongsToCore){
if (getenv("CHECK_LINKS") === "true") {
if ($element->stubBelongsToCore) {
$request = curl_init($link->getLink());
curl_setopt($request,CURLOPT_RETURNTRANSFER,1);
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
curl_exec($request);
$response = curl_getinfo($request, CURLINFO_RESPONSE_CODE);
curl_close($request);
@ -649,7 +649,7 @@ class StubsTest extends TestCase
$strtolower = strtolower(trim($parameterType));
$types = explode("|", $strtolower);
$types = $this->trunkNamespaces($types);
return implode("|", $types);;
return implode("|", $types);
}
private function checkSummary(mixed $functionsData, string $docBlockSummary, ?string $function_name): void

View File

@ -1160,6 +1160,20 @@
"problems": [
"parameter mismatch"
]
},
{
"name": "sem_get",
"problems": [
"wrong parmeter type in docs"
],
"comment": "Invalid documentation"
},
{
"name": "assert",
"problems": [
"parameter mismatch"
],
"comment": "flaky reflection o_O?"
}
],
"classes": [

View File

@ -51,7 +51,7 @@ function xml_parser_create_ns (string $encoding, string $separator = ':') {}
/**
* Use XML Parser within an object
* @link https://php.net/manual/en/function.xml-set-object.php
* @param resource $parser <p>
* @param XmlParser|resource $parser <p>
* A reference to the XML parser to use inside the object.
* </p>
* @param object &$object <p>
@ -59,12 +59,12 @@ function xml_parser_create_ns (string $encoding, string $separator = ':') {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xml_set_object ($parser, object &$object) {}
function xml_set_object (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")] $parser, object &$object) {}
/**
* Set up start and end element handlers
* @link https://php.net/manual/en/function.xml-set-element-handler.php
* @param resource $parser <p>
* @param XmlParser|resource $parser <p>
* A reference to the XML parser to set up start and end element handler functions.
* </p>
* @param callable $start_handler <p>
@ -88,12 +88,12 @@ function xml_set_object ($parser, object &$object) {}
* reference to the XML parser calling the handler.
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xml_set_element_handler ($parser, callable $start_handler, callable $end_handler) {}
function xml_set_element_handler (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")] $parser, $start_handler, $end_handler) {}
/**
* Set up character data handler
* @link https://php.net/manual/en/function.xml-set-character-data-handler.php
* @param resource $parser <p>
* @param XmlParser|resource $parser <p>
* A reference to the XML parser to set up character data handler function.
* </p>
* @param callable $handler <p>
@ -112,12 +112,12 @@ function xml_set_element_handler ($parser, callable $start_handler, callable $en
* reference to the XML parser calling the handler.
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xml_set_character_data_handler ($parser, callable $handler) {}
function xml_set_character_data_handler (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")] $parser, $handler) {}
/**
* Set up processing instruction (PI) handler
* @link https://php.net/manual/en/function.xml-set-processing-instruction-handler.php
* @param resource $parser <p>
* @param XmlParser|resource $parser <p>
* A reference to the XML parser to set up processing instruction (PI) handler function.
* </p>
* @param callable $handler <p>
@ -137,12 +137,12 @@ function xml_set_character_data_handler ($parser, callable $handler) {}
* reference to the XML parser calling the handler.
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xml_set_processing_instruction_handler ($parser, callable $handler) {}
function xml_set_processing_instruction_handler (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")] $parser, $handler) {}
/**
* Set up default handler
* @link https://php.net/manual/en/function.xml-set-default-handler.php
* @param resource $parser <p>
* @param XmlParser|resource $parser <p>
* A reference to the XML parser to set up default handler function.
* </p>
* @param callable $handler <p>
@ -161,12 +161,12 @@ function xml_set_processing_instruction_handler ($parser, callable $handler) {}
* reference to the XML parser calling the handler.
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xml_set_default_handler ($parser, callable $handler) {}
function xml_set_default_handler (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")] $parser, $handler) {}
/**
* Set up unparsed entity declaration handler
* @link https://php.net/manual/en/function.xml-set-unparsed-entity-decl-handler.php
* @param resource $parser <p>
* @param XmlParser|resource $parser <p>
* A reference to the XML parser to set up unparsed entity declaration handler function.
* </p>
* @param callable $handler <p>
@ -190,12 +190,12 @@ function xml_set_default_handler ($parser, callable $handler) {}
* handler.
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xml_set_unparsed_entity_decl_handler ($parser, callable $handler) {}
function xml_set_unparsed_entity_decl_handler (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")] $parser, $handler) {}
/**
* Set up notation declaration handler
* @link https://php.net/manual/en/function.xml-set-notation-decl-handler.php
* @param resource $parser <p>
* @param XmlParser|resource $parser <p>
* A reference to the XML parser to set up notation declaration handler function.
* </p>
* @param callable $handler <p>
@ -217,12 +217,12 @@ function xml_set_unparsed_entity_decl_handler ($parser, callable $handler) {}
* reference to the XML parser calling the handler.
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xml_set_notation_decl_handler ($parser, callable $handler) {}
function xml_set_notation_decl_handler (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")] $parser, $handler) {}
/**
* Set up external entity reference handler
* @link https://php.net/manual/en/function.xml-set-external-entity-ref-handler.php
* @param resource $parser <p>
* @param XmlParser|resource $parser <p>
* A reference to the XML parser to set up external entity reference handler function.
* </p>
* @param callable $handler <p>
@ -248,12 +248,12 @@ function xml_set_notation_decl_handler ($parser, callable $handler) {}
* reference to the XML parser calling the handler.
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xml_set_external_entity_ref_handler ($parser, callable $handler) {}
function xml_set_external_entity_ref_handler (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")] $parser, $handler) {}
/**
* Set up start namespace declaration handler
* @link https://php.net/manual/en/function.xml-set-start-namespace-decl-handler.php
* @param resource $parser <p>
* @param XmlParser|resource $parser <p>
* A reference to the XML parser.
* </p>
* @param callable $handler <p>
@ -277,12 +277,12 @@ function xml_set_external_entity_ref_handler ($parser, callable $handler) {}
* reference to the XML parser calling the handler.
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xml_set_start_namespace_decl_handler ($parser, callable $handler) {}
function xml_set_start_namespace_decl_handler (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")] $parser, $handler) {}
/**
* Set up end namespace declaration handler
* @link https://php.net/manual/en/function.xml-set-end-namespace-decl-handler.php
* @param resource $parser <p>
* @param XmlParser|resource $parser <p>
* A reference to the XML parser.
* </p>
* @param callable $handler <p>
@ -305,12 +305,12 @@ function xml_set_start_namespace_decl_handler ($parser, callable $handler) {}
* reference to the XML parser calling the handler.
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xml_set_end_namespace_decl_handler ($parser, callable $handler) {}
function xml_set_end_namespace_decl_handler (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")] $parser, $handler) {}
/**
* Start parsing an XML document
* @link https://php.net/manual/en/function.xml-parse.php
* @param resource $parser <p>
* @param XmlParser|resource $parser <p>
* A reference to the XML parser to use.
* </p>
* @param string $data <p>
@ -337,12 +337,12 @@ function xml_set_end_namespace_decl_handler ($parser, callable $handler) {}
* Entity errors are reported at the end of the data thus only if
* <i>is_final</i> is set and <b>TRUE</b>.
*/
function xml_parse ($parser, string $data, $is_final = false) {}
function xml_parse (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")] $parser, string $data, bool $is_final = false) {}
/**
* Parse XML data into an array structure
* @link https://php.net/manual/en/function.xml-parse-into-struct.php
* @param resource $parser <p>
* @param XmlParser|resource $parser <p>
* A reference to the XML parser.
* </p>
* @param string $data <p>
@ -358,13 +358,13 @@ function xml_parse ($parser, string $data, $is_final = false) {}
* success. This is not the same as <b>FALSE</b> and <b>TRUE</b>, be careful with
* operators such as ===.
*/
function xml_parse_into_struct ($parser, string $data, array &$values, array &$index)
function xml_parse_into_struct (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")] $parser, string $data, &$values, &$index)
{}
/**
* Get XML parser error code
* @link https://php.net/manual/en/function.xml-get-error-code.php
* @param resource $parser <p>
* @param XmlParser|resource $parser <p>
* A reference to the XML parser to get error code from.
* </p>
* @return int|false This function returns <b>FALSE</b> if <i>parser</i> does
@ -373,7 +373,7 @@ function xml_parse_into_struct ($parser, string $data, array &$values, array &$i
* section.
*/
#[Pure]
function xml_get_error_code ($parser) {}
function xml_get_error_code (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")] $parser) {}
/**
* Get XML parser error string
@ -390,7 +390,7 @@ function xml_error_string (int $error_code) {}
/**
* Get current line number for an XML parser
* @link https://php.net/manual/en/function.xml-get-current-line-number.php
* @param resource $parser <p>
* @param XmlParser|resource $parser <p>
* A reference to the XML parser to get line number from.
* </p>
* @return int|false This function returns <b>FALSE</b> if <i>parser</i> does
@ -398,12 +398,12 @@ function xml_error_string (int $error_code) {}
* parser is currently at in its data buffer.
*/
#[Pure]
function xml_get_current_line_number ($parser) {}
function xml_get_current_line_number (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")] $parser) {}
/**
* Get current column number for an XML parser
* @link https://php.net/manual/en/function.xml-get-current-column-number.php
* @param resource $parser <p>
* @param XmlParser|resource $parser <p>
* A reference to the XML parser to get column number from.
* </p>
* @return int|false This function returns <b>FALSE</b> if <i>parser</i> does
@ -413,12 +413,12 @@ function xml_get_current_line_number ($parser) {}
* currently at.
*/
#[Pure]
function xml_get_current_column_number ($parser) {}
function xml_get_current_column_number (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")] $parser) {}
/**
* Get current byte index for an XML parser
* @link https://php.net/manual/en/function.xml-get-current-byte-index.php
* @param resource $parser <p>
* @param XmlParser|resource $parser <p>
* A reference to the XML parser to get byte index from.
* </p>
* @return int|false This function returns <b>FALSE</b> if <i>parser</i> does
@ -426,21 +426,21 @@ function xml_get_current_column_number ($parser) {}
* the parser is currently at in its data buffer (starting at 0).
*/
#[Pure]
function xml_get_current_byte_index ($parser) {}
function xml_get_current_byte_index (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")] $parser) {}
/**
* Free an XML parser
* @link https://php.net/manual/en/function.xml-parser-free.php
* @param resource $parser A reference to the XML parser to free.
* @param XmlParser|resource $parser A reference to the XML parser to free.
* @return bool This function returns <b>FALSE</b> if <i>parser</i> does not
* refer to a valid parser, or else it frees the parser and returns <b>TRUE</b>.
*/
function xml_parser_free ($parser) {}
function xml_parser_free (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")] $parser) {}
/**
* Set options in an XML parser
* @link https://php.net/manual/en/function.xml-parser-set-option.php
* @param resource $parser <p>
* @param XmlParser|resource $parser <p>
* A reference to the XML parser to set an option in.
* </p>
* @param int $option <p>
@ -498,12 +498,12 @@ function xml_parser_free ($parser) {}
* refer to a valid parser, or if the option could not be set. Else the
* option is set and <b>TRUE</b> is returned.
*/
function xml_parser_set_option ($parser, int $option, mixed $value) {}
function xml_parser_set_option (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")] $parser, int $option, $value) {}
/**
* Get options from an XML parser
* @link https://php.net/manual/en/function.xml-parser-get-option.php
* @param resource $parser A reference to the XML parser to get an option from.
* @param XmlParser|resource $parser A reference to the XML parser to get an option from.
* @param int $option Which option to fetch. <b>XML_OPTION_CASE_FOLDING</b>
* and <b>XML_OPTION_TARGET_ENCODING</b> are available.
* See <b>xml_parser_set_option</b> for their description.
@ -513,7 +513,7 @@ function xml_parser_set_option ($parser, int $option, mixed $value) {}
* Else the option's value is returned.
*/
#[Pure]
function xml_parser_get_option ($parser, int $option) {}
function xml_parser_get_option (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")] $parser, int $option) {}
define ('XML_ERROR_NONE', 0);
define ('XML_ERROR_NO_MEMORY', 1);

View File

@ -551,7 +551,7 @@ function xmlwriter_open_memory () {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_set_indent ($writer, $enable) {}
function xmlwriter_set_indent (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, bool $enable) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -567,7 +567,7 @@ function xmlwriter_set_indent ($writer, $enable) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_set_indent_string ($writer, $indentation) {}
function xmlwriter_set_indent_string (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $indentation) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 1.0.0)<br/>
@ -579,7 +579,7 @@ function xmlwriter_set_indent_string ($writer, $indentation) {}
* This resource comes from a call to {@link https://php.net/manual/en/function.xmlwriter-open-uri.php" xmlwriter_open_uri()}
* or {@link https://php.net/manual/en/function.xmlwriter-open-memory.php" xmlwriter_open_memory()}.</p> * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_start_comment ($writer) {}
function xmlwriter_start_comment (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 1.0.0)<br/>
@ -592,7 +592,7 @@ function xmlwriter_start_comment ($writer) {}
* or {@link https://php.net/manual/en/function.xmlwriter-open-memory.php" xmlwriter_open_memory()}.</p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_end_comment ($writer) {}
function xmlwriter_end_comment (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -608,7 +608,7 @@ function xmlwriter_end_comment ($writer) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_start_attribute ($writer, $name) {}
function xmlwriter_start_attribute (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $name) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -620,7 +620,7 @@ function xmlwriter_start_attribute ($writer, $name) {}
* This resource comes from a call to {@link https://php.net/manual/en/function.xmlwriter-open-uri.php" xmlwriter_open_uri()}
* or {@link https://php.net/manual/en/function.xmlwriter-open-memory.php" xmlwriter_open_memory()}.</p> * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_end_attribute ($writer) {}
function xmlwriter_end_attribute (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -639,7 +639,7 @@ function xmlwriter_end_attribute ($writer) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_write_attribute ($writer, $name, $value) {}
function xmlwriter_write_attribute (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $name, string $value) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -661,7 +661,7 @@ function xmlwriter_write_attribute ($writer, $name, $value) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_start_attribute_ns ($writer, $prefix, $name, $namespace) {}
function xmlwriter_start_attribute_ns (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $prefix, string $name, string $namespace) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -686,7 +686,7 @@ function xmlwriter_start_attribute_ns ($writer, $prefix, $name, $namespace) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_write_attribute_ns ($writer, $prefix, $name, $namespace, $value) {}
function xmlwriter_write_attribute_ns (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $prefix, string $name, string $namespace, string $value) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -702,7 +702,7 @@ function xmlwriter_write_attribute_ns ($writer, $prefix, $name, $namespace, $val
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_start_element ($writer, $name) {}
function xmlwriter_start_element (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $name) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -714,7 +714,7 @@ function xmlwriter_start_element ($writer, $name) {}
* This resource comes from a call to {@link https://php.net/manual/en/function.xmlwriter-open-uri.php" xmlwriter_open_uri()}
* or {@link https://php.net/manual/en/function.xmlwriter-open-memory.php" xmlwriter_open_memory()}.</p> * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_end_element ($writer) {}
function xmlwriter_end_element (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer) {}
/**
* (PHP 5 &gt;= 5.2.0, PECL xmlwriter &gt;= 2.0.4)<br/>
@ -726,7 +726,7 @@ function xmlwriter_end_element ($writer) {}
* This resource comes from a call to {@link https://php.net/manual/en/function.xmlwriter-open-uri.php" xmlwriter_open_uri()}
* or {@link https://php.net/manual/en/function.xmlwriter-open-memory.php" xmlwriter_open_memory()}.</p> * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_full_end_element ($writer) {}
function xmlwriter_full_end_element (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -748,7 +748,7 @@ function xmlwriter_full_end_element ($writer) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_start_element_ns ($writer, $prefix, $name, $namespace) {}
function xmlwriter_start_element_ns (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $prefix, string $name, string $namespace) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -767,7 +767,7 @@ function xmlwriter_start_element_ns ($writer, $prefix, $name, $namespace) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_write_element ($writer, $name, $content = null) {}
function xmlwriter_write_element (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $name, string $content) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -792,7 +792,7 @@ function xmlwriter_write_element ($writer, $name, $content = null) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_write_element_ns ($writer, $prefix, $name, $namespace, $content = null) {}
function xmlwriter_write_element_ns (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $prefix, string $name, string $namespace, string $content) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -808,7 +808,7 @@ function xmlwriter_write_element_ns ($writer, $prefix, $name, $namespace, $conte
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_start_pi ($writer, $target) {}
function xmlwriter_start_pi (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $target) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -820,7 +820,7 @@ function xmlwriter_start_pi ($writer, $target) {}
* This resource comes from a call to {@link https://php.net/manual/en/function.xmlwriter-open-uri.php" xmlwriter_open_uri()}
* or {@link https://php.net/manual/en/function.xmlwriter-open-memory.php" xmlwriter_open_memory()}.</p> * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_end_pi ($writer) {}
function xmlwriter_end_pi (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -840,7 +840,7 @@ function xmlwriter_end_pi ($writer) {}
*
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_write_pi ($writer, $target, $content) {}
function xmlwriter_write_pi (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $target, string $content) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -853,7 +853,7 @@ function xmlwriter_write_pi ($writer, $target, $content) {}
* or {@link https://php.net/manual/en/function.xmlwriter-open-memory.php" xmlwriter_open_memory()}.</p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_start_cdata ($writer) {}
function xmlwriter_start_cdata (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -866,7 +866,7 @@ function xmlwriter_start_cdata ($writer) {}
* or {@link https://php.net/manual/en/function.xmlwriter-open-memory.php" xmlwriter_open_memory()}.</p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_end_cdata ($writer) {}
function xmlwriter_end_cdata (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -882,7 +882,7 @@ function xmlwriter_end_cdata ($writer) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_write_cdata ($writer, $content) {}
function xmlwriter_write_cdata (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $content) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -898,7 +898,7 @@ function xmlwriter_write_cdata ($writer, $content) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_text ($writer, $content) {}
function xmlwriter_text (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $content) {}
/**
* (PHP 5 &gt;= 5.2.0, PECL xmlwriter &gt;= 2.0.4)<br/>
@ -914,7 +914,7 @@ function xmlwriter_text ($writer, $content) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_write_raw ($writer, $content) {}
function xmlwriter_write_raw (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $content) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -936,7 +936,7 @@ function xmlwriter_write_raw ($writer, $content) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_start_document ($writer, $version = '1.0', $encoding = null, $standalone = null) {}
function xmlwriter_start_document (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $version = '1.0', string $encoding, string $standalone) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -949,7 +949,7 @@ function xmlwriter_start_document ($writer, $version = '1.0', $encoding = null,
* or {@link https://php.net/manual/en/function.xmlwriter-open-memory.php" xmlwriter_open_memory()}.</p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_end_document ($writer) {}
function xmlwriter_end_document (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -965,7 +965,7 @@ function xmlwriter_end_document ($writer) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_write_comment ($writer, $content) {}
function xmlwriter_write_comment (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $content) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -987,7 +987,7 @@ function xmlwriter_write_comment ($writer, $content) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_start_dtd ($writer, $qualifiedName, $publicId = null, $systemId = null) {}
function xmlwriter_start_dtd (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $qualifiedName, string $publicId, string $systemId) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -999,7 +999,7 @@ function xmlwriter_start_dtd ($writer, $qualifiedName, $publicId = null, $system
* This resource comes from a call to {@link https://php.net/manual/en/function.xmlwriter-open-uri.php" xmlwriter_open_uri()}
* or {@link https://php.net/manual/en/function.xmlwriter-open-memory.php" xmlwriter_open_memory()}.</p> * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_end_dtd ($writer) {}
function xmlwriter_end_dtd (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -1024,7 +1024,7 @@ function xmlwriter_end_dtd ($writer) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_write_dtd ($writer, $name, $publicId = null, $systemId = null, $content = null) {}
function xmlwriter_write_dtd (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $name, string $publicId, string $systemId, string $content) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -1040,7 +1040,7 @@ function xmlwriter_write_dtd ($writer, $name, $publicId = null, $systemId = null
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_start_dtd_element ($writer, $qualifiedName) {}
function xmlwriter_start_dtd_element (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $qualifiedName) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -1049,7 +1049,7 @@ function xmlwriter_start_dtd_element ($writer, $qualifiedName) {}
* @param $writer
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_end_dtd_element ($writer) {}
function xmlwriter_end_dtd_element (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -1068,7 +1068,7 @@ function xmlwriter_end_dtd_element ($writer) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_write_dtd_element ($writer, $name, $content) {}
function xmlwriter_write_dtd_element (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $name, string $content) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -1084,7 +1084,7 @@ function xmlwriter_write_dtd_element ($writer, $name, $content) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_start_dtd_attlist ($writer, $name) {}
function xmlwriter_start_dtd_attlist (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $name) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -1096,7 +1096,7 @@ function xmlwriter_start_dtd_attlist ($writer, $name) {}
* This resource comes from a call to {@link https://php.net/manual/en/function.xmlwriter-open-uri.php" xmlwriter_open_uri()}
* or {@link https://php.net/manual/en/function.xmlwriter-open-memory.php" xmlwriter_open_memory()}.</p> * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_end_dtd_attlist ($writer) {}
function xmlwriter_end_dtd_attlist (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -1115,7 +1115,7 @@ function xmlwriter_end_dtd_attlist ($writer) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_write_dtd_attlist ($writer, $name, $content) {}
function xmlwriter_write_dtd_attlist (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $name, string $content) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -1132,7 +1132,7 @@ function xmlwriter_write_dtd_attlist ($writer, $name, $content) {}
* @param bool $isParam
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_start_dtd_entity ($writer, $name, $isParam) {}
function xmlwriter_start_dtd_entity (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $name, bool $isParam) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -1144,7 +1144,7 @@ function xmlwriter_start_dtd_entity ($writer, $name, $isParam) {}
* This resource comes from a call to {@link https://php.net/manual/en/function.xmlwriter-open-uri.php" xmlwriter_open_uri()}
* or {@link https://php.net/manual/en/function.xmlwriter-open-memory.php" xmlwriter_open_memory()}.</p> * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_end_dtd_entity ($writer) {}
function xmlwriter_end_dtd_entity (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -1167,7 +1167,7 @@ function xmlwriter_end_dtd_entity ($writer) {}
* @param string $ndataid
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_write_dtd_entity ($writer, $name, $content, $pe, $pubid, $sysid, $ndataid) {}
function xmlwriter_write_dtd_entity (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, $name, $content, $pe, $pubid, $sysid, $ndataid) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
@ -1183,7 +1183,7 @@ function xmlwriter_write_dtd_entity ($writer, $name, $content, $pe, $pubid, $sys
* </p>
* @return string the current buffer as a string.
*/
function xmlwriter_output_memory ($writer, $flush = true) {}
function xmlwriter_output_memory (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, bool $flush = true) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 1.0.0)<br/>
@ -1201,4 +1201,4 @@ function xmlwriter_output_memory ($writer, $flush = true) {}
* Else, if using URI, this function will write the buffer and return the number of
* written bytes.
*/
function xmlwriter_flush ($writer, $empty = true) {}
function xmlwriter_flush (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, bool $empty = true) {}

View File

@ -438,7 +438,7 @@ function deflate_init (int $encoding, array $options = array()) {}
/**
* Incrementally deflate data
* @link https://php.net/manual/en/function.deflate-add.php
* @param resource $context <p>
* @param DeflateContext|resource $context <p>
* A context created with <b>deflate_init()</b>.
* </p>
* @param string $data <p>
@ -456,7 +456,7 @@ function deflate_init (int $encoding, array $options = array()) {}
* </p>
* @since 7.0
*/
function deflate_add ($context, string $data, $flush_mode = ZLIB_SYNC_FLUSH) {}
function deflate_add (#[LanguageLevelTypeAware(["8.0" => "DeflateContext"], default: "resource")] $context, string $data, int $flush_mode = ZLIB_SYNC_FLUSH) {}
/**
* Initialize an incremental inflate context
@ -485,7 +485,7 @@ function inflate_init (int $encoding, array $options = array()) {}
/**
* Incrementally inflate encoded data
* @link https://php.net/manual/en/function.inflate-add.php
* @param resource $context <p>
* @param InflateContext|resource $context <p>
* A context created with <b>inflate_init()</b>.
* </p>
* @param string $data <p>
@ -503,25 +503,25 @@ function inflate_init (int $encoding, array $options = array()) {}
* </p>
* @since 7.0
*/
function inflate_add ($context, string $data, $flush_mode = ZLIB_SYNC_FLUSH) {}
function inflate_add (#[LanguageLevelTypeAware(["8.0" => "InflateContext"], default: "resource")] $context, string $data, int $flush_mode = ZLIB_SYNC_FLUSH) {}
/**
* Get number of bytes read so far
* @param resource $context
* @param InflateContext|resource $context
* @return bool
* @since 7.2
*/
#[Pure]
function inflate_get_read_len ($context){}
function inflate_get_read_len (#[LanguageLevelTypeAware(["8.0" => "InflateContext"], default: "resource")] $context){}
/**
* Get decompression status
* @param resource $context
* @param InflateContext|resource $context
* @return bool
* @since 7.2
*/
#[Pure]
function inflate_get_status($context) {}
function inflate_get_status(#[LanguageLevelTypeAware(["8.0" => "InflateContext"], default: "resource")] $context) {}
/**
* @since 8.0