Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Attempt to fix StubsConstantsAndParametersValuesTest::testFunctionsDefaultParametersValue() #1574

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions gd/gd.php
Original file line number Diff line number Diff line change
Expand Up @@ -1028,17 +1028,17 @@ function imagepng(GdImage $image, $file = null, int $quality = -1, int $filters
* Output a WebP image to browser or file
* @link https://php.net/manual/en/function.imagewebp.php
* @param resource|GdImage $image
* @param string $to [optional] <p>
* The path to save the file to. If not set or null, the raw image stream
* will be outputted directly.
* @param resource|string|null $file [optional] <p>
* The path or an open stream resource (which is automatically closed after this function returns)
* to save the file to. If not set or null, the raw image stream will be output directly.
* </p>
* @param int $quality [optional] <p>
* quality ranges from 0 (worst quality, smaller file) to 100 (best quality, biggest file).
* </p>
* @return bool true on success or false on failure.
* @since 5.4
*/
function imagewebp($image, $to = null, $quality = 80): bool {}
function imagewebp(GdImage $image, $file = null, int $quality = -1): bool {}

/**
* Output image to browser or file
Expand Down Expand Up @@ -1071,7 +1071,7 @@ function imagegif(GdImage $image, $file = null): bool {}
* </p>
* @return bool true on success or false on failure.
*/
function imagejpeg($image, $file = null, $quality = null): bool {}
function imagejpeg(GdImage $image, $file = null, int $quality = -1): bool {}

/**
* Output image to browser or file
Expand Down Expand Up @@ -1569,9 +1569,10 @@ function imagedashedline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int
* search for files that do not begin with a leading '/' by appending
* '.ttf' to the filename and searching along a library-defined font path.
* </p>
* @param string $text <p>
* @param string $string <p>
* The string to be measured.
* </p>
* @param array $options [optional]
* @return array|false imagettfbbox returns an array with 8
* elements representing four points making the bounding box of the
* text on success and false on error.
Expand Down Expand Up @@ -1618,7 +1619,7 @@ function imagedashedline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int
* corner seeing the text horizontally.
*/
#[Pure]
function imagettfbbox($size, $angle, $font_filename, $text) {}
function imagettfbbox(float $size, float $angle, string $font_filename, string $string, #[PhpStormStubsElementAvailable(from: '8.0')] array $options = []): array|false {}

/**
* Write text to the image using TrueType fonts
Expand Down Expand Up @@ -1703,14 +1704,15 @@ function imagettfbbox($size, $angle, $font_filename, $text) {}
* If a character is used in the string which is not supported by the
* font, a hollow rectangle will replace the character.
* </p>
* @param array $options [optional]
* @return array|false an array with 8 elements representing four points making the
* bounding box of the text. The order of the points is lower left, lower
* right, upper right, upper left. The points are relative to the text
* regardless of the angle, so "upper left" means in the top left-hand
* corner when you see the text horizontally.
* Returns false on error.
*/
function imagettftext(GdImage $image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array|false {}
function imagettftext(GdImage $image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, #[PhpStormStubsElementAvailable(from: '8.0')] array $options = []): array|false {}

/**
* Give the bounding box of a text using fonts via freetype2
Expand All @@ -1729,10 +1731,10 @@ function imagettftext(GdImage $image, float $size, float $angle, int $x, int $y,
* search for files that do not begin with a leading '/' by appending
* '.ttf' to the filename and searching along a library-defined font path.
* </p>
* @param string $text <p>
* @param string $string <p>
* The string to be measured.
* </p>
* @param array $extrainfo [optional] <p>
* @param array $options [optional] <p>
* <table>
* Possible array indexes for extrainfo
* <tr valign="top">
Expand Down Expand Up @@ -1790,7 +1792,7 @@ function imagettftext(GdImage $image, float $size, float $angle, int $x, int $y,
* Returns false on error.
*/
#[Pure]
function imageftbbox($size, $angle, $font_filename, $text, $extrainfo = null) {}
function imageftbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array|false {}

/**
* Write text to the image using fonts using FreeType 2
Expand Down Expand Up @@ -1858,7 +1860,7 @@ function imageftbbox($size, $angle, $font_filename, $text, $extrainfo = null) {}
* @param string $text <p>
* Text to be inserted into image.
* </p>
* @param array $extrainfo [optional] <p>
* @param array $options [optional] <p>
* <table>
* Possible array indexes for extrainfo
* <tr valign="top">
Expand Down Expand Up @@ -1908,7 +1910,7 @@ function imageftbbox($size, $angle, $font_filename, $text, $extrainfo = null) {}
* </tr>
* Returns false on error.
*/
function imagefttext($image, $size, $angle, $x, $y, $color, $font_filename, $text, $extrainfo = null) {}
function imagefttext(GdImage $image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array|false {}

/**
* Load a PostScript Type 1 font from file
Expand Down
62 changes: 37 additions & 25 deletions odbc/odbc.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function odbc_commit($connection_id) {}
* @param string $password <p>
* The password.
* </p>
* @param int $cursor_type [optional] <p>
* @param int $cursor_option [optional] <p>
* This sets the type of cursor to be used
* for this connection. This parameter is not normally needed, but
* can be useful for working around problems with some ODBC drivers.
Expand All @@ -135,7 +135,7 @@ function odbc_commit($connection_id) {}
* </p>
* @return resource|false an ODBC connection or (<b>FALSE</b>) on error.
*/
function odbc_connect($dsn, $user, $password, $cursor_type = null) {}
function odbc_connect($dsn, $user, $password, $cursor_option = SQL_CUR_USE_DRIVER) {}

/**
* Get cursorname
Expand Down Expand Up @@ -166,10 +166,10 @@ function odbc_data_source($connection_id, $fetch_type) {}
/**
* Execute a prepared statement
* @link https://php.net/manual/en/function.odbc-execute.php
* @param resource $result_id <p>
* @param resource $statement <p>
* The result id resource, from <b>odbc_prepare</b>.
* </p>
* @param array $parameters_array [optional] <p>
* @param array $params [optional] <p>
* Parameters in <i>parameter_array</i> will be
* substituted for placeholders in the prepared statement in order.
* Elements of this array will be converted to strings by calling this
Expand All @@ -189,7 +189,7 @@ function odbc_data_source($connection_id, $fetch_type) {}
* executing the query directly with <b>odbc_exec</b>).
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function odbc_execute($result_id, array $parameters_array = null) {}
function odbc_execute($statement, array $params = []) {}

/**
* Get the last error code
Expand Down Expand Up @@ -240,30 +240,30 @@ function odbc_exec($connection_id, $query_string, #[PhpStormStubsElementAvailabl
/**
* Fetch a result row as an associative array
* @link https://php.net/manual/en/function.odbc-fetch-array.php
* @param resource $result <p>
* @param resource $statement <p>
* The result resource from <b>odbc_exec</b>.
* </p>
* @param int $rownumber [optional] <p>
* @param int $row [optional] <p>
* Optionally choose which row number to retrieve.
* </p>
* @return array|false an array that corresponds to the fetched row, or <b>FALSE</b> if there
* are no more rows.
*/
function odbc_fetch_array($result, $rownumber = null) {}
function odbc_fetch_array($statement, $row = -1) {}

/**
* Fetch a result row as an object
* @link https://php.net/manual/en/function.odbc-fetch-object.php
* @param resource $result <p>
* @param resource $statement <p>
* The result resource from <b>odbc_exec</b>.
* </p>
* @param int $rownumber [optional] <p>
* @param int $row [optional] <p>
* Optionally choose which row number to retrieve.
* </p>
* @return object|false an object that corresponds to the fetched row, or <b>FALSE</b> if there
* are no more rows.
*/
function odbc_fetch_object($result, $rownumber = null) {}
function odbc_fetch_object($statement, $row = -1) {}

/**
* Fetch a row
Expand Down Expand Up @@ -293,22 +293,22 @@ function odbc_fetch_row($result_id, $row_number = null) {}
/**
* Fetch one result row into array
* @link https://php.net/manual/en/function.odbc-fetch-into.php
* @param resource $result_id <p>
* @param resource $statement <p>
* The result resource.
* </p>
* @param array &$result_array <p>
* @param array &$array <p>
* The result array
* that can be of any type since it will be converted to type
* array. The array will contain the column values starting at array
* index 0.
* </p>
* @param int $rownumber [optional] <p>
* @param int $row [optional] <p>
* The row number.
* </p>
* @return int the number of columns in the result;
* <b>FALSE</b> on error.
*/
function odbc_fetch_into($result_id, array &$result_array, $rownumber = null) {}
function odbc_fetch_into($statement, array &$array, $row = 0) {}

/**
* Get the length (precision) of a field
Expand Down Expand Up @@ -389,7 +389,7 @@ function odbc_free_result($result_id) {}
/**
* Retrieves information about data types supported by the data source
* @link https://php.net/manual/en/function.odbc-gettypeinfo.php
* @param resource $connection_id <p>The ODBC connection identifier,
* @param resource $odbc <p>The ODBC connection identifier,
* see <b>odbc_connect</b> for details.</p>
* @param int $data_type [optional] <p>
* The data type, which can be used to restrict the information to a
Expand Down Expand Up @@ -419,7 +419,7 @@ function odbc_free_result($result_id) {}
* The result set is ordered by DATA_TYPE and TYPE_NAME.
* </p>
*/
function odbc_gettypeinfo($connection_id, $data_type = null) {}
function odbc_gettypeinfo($odbc, $data_type = 0) {}

/**
* Handling of LONG columns
Expand Down Expand Up @@ -473,11 +473,11 @@ function odbc_num_rows($result_id) {}
* @param string $dsn
* @param string $user
* @param string $password
* @param int $cursor_type [optional]
* @param int $cursor_option [optional]
* @return resource|false an ODBC connection id or 0 (<b>FALSE</b>) on
* error.
*/
function odbc_pconnect($dsn, $user, $password, $cursor_type = null) {}
function odbc_pconnect($dsn, $user, $password, $cursor_option = SQL_CUR_USE_DRIVER) {}

/**
* Prepares a statement for execution
Expand Down Expand Up @@ -511,7 +511,7 @@ function odbc_result($result_id, $field) {}
/**
* Print result as HTML table
* @link https://php.net/manual/en/function.odbc-result-all.php
* @param resource $result_id <p>
* @param resource $statement <p>
* The result identifier.
* </p>
* @param string $format [optional] <p>
Expand All @@ -520,7 +520,7 @@ function odbc_result($result_id, $field) {}
* @return int|false the number of rows in the result or <b>FALSE</b> on error.
* @deprecated 8.1
*/
function odbc_result_all($result_id, $format = null) {}
function odbc_result_all($statement, $format = '') {}

/**
* Rollback a transaction
Expand Down Expand Up @@ -827,8 +827,13 @@ function odbc_foreignkeys($connection_id, $pk_qualifier, $pk_owner, $pk_table, $
/**
* Get the list of procedures stored in a specific data source
* @link https://php.net/manual/en/function.odbc-procedures.php
* @param resource $connection_id <p>The ODBC connection identifier,
* @param resource $odbc <p>The ODBC connection identifier,
* see <b>odbc_connect</b> for details.</p>
* @param string|null $catalog <p>The catalog ('qualifier' in ODBC 2 parlance).</p>
* @param string|null $schema <p>The schema ('owner' in ODBC 2 parlance). This parameter accepts the
* following search patterns: % to match zero or more characters, and _ to match a single character.</p>
* @param string|null $procedure <p>The proc. This parameter accepts the following search patterns:
* % to match zero or more characters, and _ to match a single character.</p>
* @return resource|false <p>an ODBC
* result identifier containing the information or <b>FALSE</b> on failure.
* </p>
Expand All @@ -844,13 +849,20 @@ function odbc_foreignkeys($connection_id, $pk_qualifier, $pk_owner, $pk_table, $
* PROCEDURE_TYPE
* </p>
*/
function odbc_procedures($connection_id) {}
function odbc_procedures($odbc, $catalog = null, $schema = null, $procedure = null) {}

/**
* Retrieve information about parameters to procedures
* @link https://php.net/manual/en/function.odbc-procedurecolumns.php
* @param resource $connection_id <p>The ODBC connection identifier,
* @param resource $odbc <p>The ODBC connection identifier,
* see <b>odbc_connect</b> for details.</p>
* @param string|null $catalog <p>The catalog ('qualifier' in ODBC 2 parlance).</p>
* @param string|null $schema <p>The schema ('owner' in ODBC 2 parlance). This parameter accepts the
* following search patterns: % to match zero or more characters, and _ to match a single character.</p>
* @param string|null $procedure <p>The proc. This parameter accepts the following search patterns:
* % to match zero or more characters, and _ to match a single character.</p>
* @param string|null $column <p>The column. This parameter accepts the following search patterns:
* % to match zero or more characters, and _ to match a single character.</p>
* @return resource|false <p>the list of input and output parameters, as well as the
* columns that make up the result set for the specified procedures.
* Returns an ODBC result identifier or <b>FALSE</b> on failure.
Expand All @@ -872,7 +884,7 @@ function odbc_procedures($connection_id) {}
* REMARKS
* </p>
*/
function odbc_procedurecolumns($connection_id) {}
function odbc_procedurecolumns($odbc, $catalog = null, $schema = null, $procedure = null, $column = null) {}

/**
* Alias of <b>odbc_exec</b>
Expand Down
4 changes: 3 additions & 1 deletion tests/DockerImages/5.6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ RUN set -eux; \
bash gcc g++ make autoconf pkgconfig git \
libmcrypt-dev imap-dev php7-imap php7-enchant bzip2-dev gettext-dev libxml2-dev php7-dev php7-gd icu-dev \
php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear rabbitmq-c librrd libzip-dev rrdtool-dev \
gmp-dev yaml yaml-dev fann fann-dev
gmp-dev yaml yaml-dev fann fann-dev libjpeg-turbo-dev libpng-dev libwebp-dev freetype-dev

RUN docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-webp-dir=/usr --with-jpeg-dir=/usr

RUN docker-php-ext-install imap gmp sockets intl bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \
pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap
Expand Down
4 changes: 3 additions & 1 deletion tests/DockerImages/7.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ RUN set -eux; \
bash gcc g++ make autoconf pkgconfig git \
libmcrypt-dev imap-dev php7-imap php7-enchant bzip2-dev gettext-dev libxml2-dev php7-dev php7-gd icu-dev \
php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear rabbitmq-c librrd libzip-dev rrdtool-dev \
gmp-dev yaml yaml-dev fann fann-dev aspell-dev
gmp-dev yaml yaml-dev fann fann-dev aspell-dev libjpeg-turbo-dev libpng-dev libwebp-dev freetype-dev

RUN docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-webp-dir=/usr --with-jpeg-dir=/usr

RUN docker-php-ext-install imap gmp sockets intl bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \
pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pspell
Expand Down
4 changes: 3 additions & 1 deletion tests/DockerImages/7.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ RUN set -eux; \
libmcrypt-dev imap-dev php7-imap php7-enchant bzip2-dev gettext-dev libxml2-dev php7-dev php7-gd icu-dev \
php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear rabbitmq-c rabbitmq-c-dev librrd \
libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \
libpng-dev gpgme gpgme-dev aspell-dev
libpng-dev gpgme gpgme-dev aspell-dev libjpeg-turbo-dev libpng-dev libwebp-dev freetype-dev

RUN docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-webp-dir=/usr --with-jpeg-dir=/usr

RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \
pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pspell
Expand Down
4 changes: 3 additions & 1 deletion tests/DockerImages/7.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ RUN set -eux; \
libmcrypt-dev imap-dev php7-imap php7-enchant bzip2-dev gettext-dev libxml2-dev php7-dev php7-gd icu-dev \
php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear rabbitmq-c rabbitmq-c-dev librrd \
libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \
libpng-dev gpgme gpgme-dev aspell-dev
libpng-dev gpgme gpgme-dev aspell-dev libjpeg-turbo-dev libpng-dev libwebp-dev freetype-dev

RUN docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-webp-dir=/usr --with-jpeg-dir=/usr

RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \
pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pspell
Expand Down
4 changes: 3 additions & 1 deletion tests/DockerImages/7.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ RUN set -eux; \
libmcrypt-dev imap-dev php7-imap enchant2 php8-enchant bzip2-dev gettext-dev libxml2-dev php7-dev php7-gd icu-dev \
php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear rabbitmq-c rabbitmq-c-dev librrd \
libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \
libpng-dev gpgme gpgme-dev libpq-dev aspell-dev
libpng-dev gpgme gpgme-dev libpq-dev aspell-dev libjpeg-turbo-dev libpng-dev libwebp-dev freetype-dev

RUN docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-webp-dir=/usr --with-jpeg-dir=/usr

RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \
pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pgsql pspell
Expand Down
4 changes: 3 additions & 1 deletion tests/DockerImages/7.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ RUN set -eux; \
libmcrypt-dev imap-dev enchant2 php8-enchant bzip2-dev gettext-dev libxml2-dev icu-dev \
libffi-dev openssl-dev rabbitmq-c rabbitmq-c-dev librrd \
libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \
libpng-dev gpgme gpgme-dev libpq-dev aspell-dev
libpng-dev gpgme gpgme-dev libpq-dev aspell-dev libjpeg-turbo-dev libpng-dev libwebp-dev freetype-dev

RUN docker-php-ext-configure gd --with-jpeg --with-webp --with-freetype

RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \
pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pgsql pspell
Expand Down
4 changes: 3 additions & 1 deletion tests/DockerImages/8.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ RUN set -eux; \
libmcrypt-dev imap-dev php8-imap enchant2 php8-enchant bzip2-dev gettext-dev libxml2-dev php8-dev php8-gd icu-dev \
php8-zip php8-tidy php8-intl libffi-dev openssl-dev php8-pear rabbitmq-c rabbitmq-c-dev librrd \
libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \
libpng-dev gpgme gpgme-dev libpq-dev aspell-dev
libpng-dev gpgme gpgme-dev libpq-dev aspell-dev libjpeg-turbo-dev libpng-dev libwebp-dev freetype-dev

RUN docker-php-ext-configure gd --with-jpeg --with-webp --with-freetype

RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \
pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pgsql pspell
Expand Down
4 changes: 3 additions & 1 deletion tests/DockerImages/8.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ RUN set -eux; \
libmcrypt-dev imap-dev php-imap enchant2 php-enchant bzip2-dev gettext-dev libxml2-dev php81-dev php-gd icu-dev \
php-zip php-tidy php-intl libffi-dev openssl-dev php81-pear rabbitmq-c rabbitmq-c-dev librrd \
libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \
libpng-dev gpgme gpgme-dev libpq-dev aspell-dev
libpng-dev gpgme gpgme-dev libpq-dev aspell-dev libjpeg-turbo-dev libpng-dev libwebp-dev freetype-dev

RUN docker-php-ext-configure gd --with-jpeg --with-webp --with-freetype

RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \
pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pgsql pspell
Expand Down
Loading
Loading