Commit fd7e3cac6d for wordpress.org
commit fd7e3cac6d39f40fed6ae98cedf58da4c88bc56c
Author: westonruter <westonruter@git.wordpress.org>
Date: Fri Oct 30 15:54:55 2026 +0000
Docs: Correct PHPDoc types in the AVIF info parser.
Several types in the bundled copy of libavifinfo are not PHPDoc types: `binary string`, `stream`, and `Status`, the last of which stands for the integer status constants. In the `Avifinfo` namespace each one resolves to a nonexistent class, and four methods also documented a `$handle` parameter that they do not take. These are replaced with `string`, `resource`, and `int`, and the stale tags are removed. Only docblocks change.
The file is excluded from PHPStan analysis as third-party code, so the baselines do not record the resulting errors. They do reach the php-stubs/wordpress-stubs package, whose generator has to rewrite the `binary string` tags before generating the stubs.
Developed in https://github.com/WordPress/wordpress-develop/pull/15198.
Follow-up to r57524.
Props westonruter, mukesh27, adamsilverstein, szepeviktor.
See #65817.
Built from https://develop.svn.wordpress.org/trunk@65047
git-svn-id: http://core.svn.wordpress.org/trunk@64197 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/class-avif-info.php b/wp-includes/class-avif-info.php
index da31e18d9a..1dd3fd714e 100644
--- a/wp-includes/class-avif-info.php
+++ b/wp-includes/class-avif-info.php
@@ -35,9 +35,9 @@ const UNDEFINED = 0; // Value was not yet parsed.
/**
* Reads an unsigned integer with most significant bits first.
*
- * @param binary string $input Must be at least $num_bytes-long.
- * @param int $num_bytes Number of parsed bytes.
- * @return int Value.
+ * @param string $input Must be at least $num_bytes-long.
+ * @param int $num_bytes Number of parsed bytes.
+ * @return int Value.
*/
function read_big_endian( $input, $num_bytes ) {
if ( $num_bytes == 1 ) {
@@ -57,9 +57,9 @@ function read_big_endian( $input, $num_bytes ) {
/**
* Reads bytes and advances the stream position by the same count.
*
- * @param stream $handle Bytes will be read from this resource.
- * @param int $num_bytes Number of bytes read. Must be greater than 0.
- * @return binary string|false The raw bytes or false on failure.
+ * @param resource $handle Bytes will be read from this resource.
+ * @param int $num_bytes Number of bytes read. Must be greater than 0.
+ * @return string|false The raw bytes or false on failure.
*/
function read( $handle, $num_bytes ) {
$data = fread( $handle, $num_bytes );
@@ -69,9 +69,9 @@ function read( $handle, $num_bytes ) {
/**
* Advances the stream position by the given offset.
*
- * @param stream $handle Bytes will be skipped from this resource.
- * @param int $num_bytes Number of skipped bytes. Can be 0.
- * @return bool True on success or false on failure.
+ * @param resource $handle Bytes will be skipped from this resource.
+ * @param int $num_bytes Number of skipped bytes. Can be 0.
+ * @return bool True on success or false on failure.
*/
// Skips 'num_bytes' from the 'stream'. 'num_bytes' can be zero.
function skip( $handle, $num_bytes ) {
@@ -123,9 +123,9 @@ class Features {
/**
* Binds the width, height, bit depth and number of channels from stored internal features.
*
- * @param int $target_item_id Id of the item whose features will be bound.
- * @param int $tile_depth Maximum recursion to search within tile-parent relations.
- * @return Status FOUND on success or NOT_FOUND on failure.
+ * @param int $target_item_id Id of the item whose features will be bound.
+ * @param int $tile_depth Maximum recursion to search within tile-parent relations.
+ * @return int FOUND on success or NOT_FOUND on failure.
*/
private function get_item_features( $target_item_id, $tile_depth ) {
foreach ( $this->props as $prop ) {
@@ -187,7 +187,7 @@ class Features {
/**
* Finds the width, height, bit depth and number of channels of the primary item.
*
- * @return Status FOUND on success or NOT_FOUND on failure.
+ * @return int FOUND on success or NOT_FOUND on failure.
*/
public function get_primary_item_features() {
// Nothing to do without the primary item ID.
@@ -223,10 +223,10 @@ class Box {
/**
* Reads the box header.
*
- * @param stream $handle The resource the header will be parsed from.
- * @param int $num_parsed_boxes The total number of parsed boxes. Prevents timeouts.
- * @param int $num_remaining_bytes The number of bytes that should be available from the resource.
- * @return Status FOUND on success or an error on failure.
+ * @param resource $handle The resource the header will be parsed from.
+ * @param int $num_parsed_boxes The total number of parsed boxes. Prevents timeouts.
+ * @param int $num_remaining_bytes The number of bytes that should be available from the resource.
+ * @return int FOUND on success or an error on failure.
*/
public function parse( $handle, &$num_parsed_boxes, $num_remaining_bytes = MAX_SIZE ) {
// See ISO/IEC 14496-12:2012(E) 4.2
@@ -336,9 +336,8 @@ class Parser {
* "ispe" is used for width and height, "pixi" and "av1C" are used for bit depth
* and number of channels, and "auxC" is used for alpha.
*
- * @param stream $handle The resource the box will be parsed from.
- * @param int $num_remaining_bytes The number of bytes that should be available from the resource.
- * @return Status FOUND on success or an error on failure.
+ * @param int $num_remaining_bytes The number of bytes that should be available from the resource.
+ * @return int FOUND on success or an error on failure.
*/
private function parse_ipco( $num_remaining_bytes ) {
$box_index = 1; // 1-based index. Used for iterating over properties.
@@ -492,9 +491,8 @@ class Parser {
*
* The "ipco" box contains the properties which are linked to items by the "ipma" box.
*
- * @param stream $handle The resource the box will be parsed from.
- * @param int $num_remaining_bytes The number of bytes that should be available from the resource.
- * @return Status FOUND on success or an error on failure.
+ * @param int $num_remaining_bytes The number of bytes that should be available from the resource.
+ * @return int FOUND on success or an error on failure.
*/
private function parse_iprp( $num_remaining_bytes ) {
do {
@@ -598,9 +596,8 @@ class Parser {
* can be used to infer bit depth and number of channels for the primary item
* when the latter does not have these properties.
*
- * @param stream $handle The resource the box will be parsed from.
- * @param int $num_remaining_bytes The number of bytes that should be available from the resource.
- * @return Status FOUND on success or an error on failure.
+ * @param int $num_remaining_bytes The number of bytes that should be available from the resource.
+ * @return int FOUND on success or an error on failure.
*/
private function parse_iref( $num_remaining_bytes ) {
while ( $num_remaining_bytes > 0 ) {
@@ -673,9 +670,8 @@ class Parser {
* It looks for the primary item ID in the "pitm" box and recurses into other boxes
* to find its features.
*
- * @param stream $handle The resource the box will be parsed from.
- * @param int $num_remaining_bytes The number of bytes that should be available from the resource.
- * @return Status FOUND on success or an error on failure.
+ * @param int $num_remaining_bytes The number of bytes that should be available from the resource.
+ * @return int FOUND on success or an error on failure.
*/
private function parse_meta( $num_remaining_bytes ) {
do {
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 5216b2f0cb..5b7fa578be 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.2-beta3-65046';
+$wp_version = '7.2-beta3-65047';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.