-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
* Lock file maintenance * Address Phan issues due to php-stubs/wordpress-stubs upgrade * Some typecasts to account for better Core type delcarations. * Suppress `current_user_can_for_blog` → `current_user_can_for_site` until we drop 6.6 support. * Hack around Core SimplePie renaming Core upgraded their copy-pasted SimplePie library, which included renaming all the classes. While they did provide back-compat aliases, we run into a few problems: * A method parameter type of `SimplePie_Item` won't accept `SimplePie\Item`, while `SimplePie\Item` won't work on WP 6.6. * It's really hard to make Phan happy for both the two runs (with 6.7 stubs and with 6.6 stubs). The best I was able to come up with was this: * Turn on `enable_class_alias_support`. * Alias `Jetpack\SimplePie\<name>` to the appropriate classes, and use those aliases everywhere. * Have phan load only one of the two alias files, depending on which run it's doing. * Merge all the test mocks into one file and load them from bootstrap.php. --------- Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Brad Jorsch <brad.jorsch@automattic.com> Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/12261510871 Upstream-Ref: Automattic/jetpack@ceebd52
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'lodash', 'moment', 'react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => '53248d5229fa0c3eac21'); | ||
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'lodash', 'moment', 'react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => '13d80a01e44cc6f4abd0'); |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'lodash', 'moment', 'react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => '8138be90de8e2120cfc1'); | ||
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'lodash', 'moment', 'react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => '3a07aa4a1cfaa8385f5d'); |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array('jetpack-connection', 'lodash', 'moment', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => 'd592d9a676a6a4a7e406'); | ||
<?php return array('dependencies' => array('jetpack-connection', 'lodash', 'moment', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => 'e67a6ff5b1c0f6c3ca3c'); |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'lodash', 'moment', 'react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => '0ca194aad382fe62ee9e'); | ||
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'lodash', 'moment', 'react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => '996ef1308a385d3a9379'); |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array('wp-dom-ready', 'wp-escape-html', 'wp-i18n', 'wp-polyfill'), 'version' => 'eb66b7edd1603163a046'); | ||
<?php return array('dependencies' => array('wp-dom-ready', 'wp-escape-html', 'wp-i18n', 'wp-polyfill'), 'version' => 'fa8325cba71797dd4af4'); |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'jquery', 'lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'abd950c0d8674cb9569d'); | ||
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'jquery', 'lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '185f783d10b0077da4ec'); |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '2864c68e8b7d87606467'); | ||
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '0602aaf38455f356ca0f'); |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
/** | ||
* Class aliases for SimplePie. | ||
* | ||
* Core renamed the classes in 6.7, and for type declarations and such to work right we need to use the correct names. | ||
* This provides aliases for use with WordPress 6.7. | ||
* | ||
* @todo Remove this once we drop support for WordPress 6.6 | ||
* | ||
* @package automattic/jetpack | ||
*/ | ||
|
||
class_alias( SimplePie\SimplePie::class, Jetpack\SimplePie\SimplePie::class ); | ||
class_alias( SimplePie\File::class, Jetpack\SimplePie\File::class ); | ||
class_alias( SimplePie\Item::class, Jetpack\SimplePie\Item::class ); | ||
class_alias( SimplePie\Locator::class, Jetpack\SimplePie\Locator::class ); | ||
class_alias( SimplePie\Enclosure::class, Jetpack\SimplePie\Enclosure::class ); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
/** | ||
* Class aliases for SimplePie. | ||
* | ||
* Core renamed the classes in 6.7, and for type declarations and such to work right we need to use the correct names. | ||
* This provides aliases for use with WordPress 6.6. | ||
* | ||
* @todo Remove this once we drop support for WordPress 6.6 | ||
* | ||
* @package automattic/jetpack | ||
*/ | ||
|
||
class_alias( SimplePie::class, Jetpack\SimplePie\SimplePie::class ); | ||
class_alias( SimplePie_File::class, Jetpack\SimplePie\File::class ); | ||
class_alias( SimplePie_Item::class, Jetpack\SimplePie\Item::class ); | ||
class_alias( SimplePie_Locator::class, Jetpack\SimplePie\Locator::class ); | ||
class_alias( SimplePie_Enclosure::class, Jetpack\SimplePie\Enclosure::class ); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
/** | ||
* Class aliases for SimplePie. | ||
* | ||
* Core renamed the classes in 6.7, and for type declarations and such to work right we need to use the correct names. | ||
* This selects the correct alias file for the current version of WordPress. | ||
* | ||
* @todo Remove this once we drop support for WordPress 6.6 | ||
* | ||
* @package automattic/jetpack | ||
*/ | ||
|
||
if ( ! defined( 'ABSPATH' ) ) { | ||
return; | ||
} | ||
|
||
require_once ABSPATH . '/wp-includes/class-simplepie.php'; | ||
// @phan-suppress-next-line PhanUndeclaredClassReference -- Being tested for. @phan-suppress-current-line UnusedPluginSuppression | ||
if ( class_exists( SimplePie\SimplePie::class ) ) { | ||
require_once __DIR__ . '/jp-simplepie-alias-new.php'; | ||
} else { | ||
require_once __DIR__ . '/jp-simplepie-alias-old.php'; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array(), 'version' => '0d9b7c1c5507602fae89'); | ||
<?php return array('dependencies' => array(), 'version' => '3d6b6c0a2cee025f46f3'); |