Skip to content

Commit 392df19

Browse files
committed
Build/Test Tools: Preserve precise video metadata type inference.
Remove the broad `$metadata` annotation and the always-true `created_timestamp` guard in `wp_read_video_metadata()`. Preserve the timestamp helper call and strict `false` check. Combine the pointer array type annotations with their explanatory docblocks. Follow-up to [65149]. Developed in: WordPress#15303 Props westonruter. See #65817. git-svn-id: https://develop.svn.wordpress.org/trunk@65158 602fd350-edb4-49c9-b593-d223f7449a82
1 parent cb18594 commit 392df19

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

‎src/wp-admin/includes/class-wp-internal-pointers.php‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final class WP_Internal_Pointers {
3535
* @param string $hook_suffix The current admin page.
3636
*/
3737
public static function enqueue_scripts( $hook_suffix ) {
38-
/*
38+
/**
3939
* Register feature pointers
4040
*
4141
* Format:
@@ -47,8 +47,9 @@ public static function enqueue_scripts( $hook_suffix ) {
4747
* array(
4848
* 'themes.php' => 'wp390_widgets'
4949
* )
50+
*
51+
* @var array<string, string|string[]> $registered_pointers
5052
*/
51-
/** @var array<string, string|string[]> $registered_pointers */
5253
$registered_pointers = array(
5354
// None currently.
5455
);
@@ -60,7 +61,7 @@ public static function enqueue_scripts( $hook_suffix ) {
6061

6162
$pointers = (array) $registered_pointers[ $hook_suffix ];
6263

63-
/*
64+
/**
6465
* Specify required capabilities for feature pointers
6566
*
6667
* Format:
@@ -72,8 +73,9 @@ public static function enqueue_scripts( $hook_suffix ) {
7273
* array(
7374
* 'wp390_widgets' => array( 'edit_theme_options' )
7475
* )
76+
*
77+
* @var array<string, string[]> $caps_required
7578
*/
76-
/** @var array<string, string[]> $caps_required */
7779
$caps_required = array(
7880
// None currently.
7981
);

‎src/wp-admin/includes/media.php‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3677,7 +3677,6 @@ function wp_read_video_metadata( $file ) {
36773677
return false;
36783678
}
36793679

3680-
/** @var array<string, mixed> $metadata */
36813680
$metadata = array();
36823681

36833682
if ( ! defined( 'GETID3_TEMP_DIR' ) ) {
@@ -3751,12 +3750,9 @@ function wp_read_video_metadata( $file ) {
37513750
$metadata['audio'] = $data['audio'];
37523751
}
37533752

3754-
if ( empty( $metadata['created_timestamp'] ) ) {
3755-
$created_timestamp = wp_get_media_creation_timestamp( $data );
3756-
3757-
if ( false !== $created_timestamp ) {
3758-
$metadata['created_timestamp'] = $created_timestamp;
3759-
}
3753+
$created_timestamp = wp_get_media_creation_timestamp( $data );
3754+
if ( false !== $created_timestamp ) {
3755+
$metadata['created_timestamp'] = $created_timestamp;
37603756
}
37613757

37623758
wp_add_id3_tag_data( $metadata, $data );

0 commit comments

Comments
 (0)