Skip to content

Commit e2214ff

Browse files
committed
Code Quality: Resolve the method.unused PHPStan errors.
The three private methods in the baseline are unused in core on purpose, so they are kept and ignored inline with a reason rather than left in a baseline, which would invite contributors to remove them. This empties the baseline, so it is removed. Developed in #16254. Follow-up to r42766, r44787, r60999, r63023, r65773. Props huzaifaalmesbah, mukesh27. See #66739. git-svn-id: https://develop.svn.wordpress.org/trunk@65837 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 455f616 commit e2214ff

4 files changed

Lines changed: 6 additions & 35 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ public static function enqueue_scripts( $hook_suffix ) {
115115
* @param string $pointer_id The pointer ID.
116116
* @param string $selector The HTML elements, on which the pointer should be attached.
117117
* @param array $args Arguments to be passed to the pointer JS (see wp-pointer.js).
118+
*
119+
* @phpstan-ignore method.unused (Kept for the pointer_* methods that future admin pointers add to this class.)
118120
*/
119121
private static function print_js( $pointer_id, $selector, $args ) {
120122
if ( empty( $pointer_id ) || empty( $selector ) || empty( $args ) || empty( $args['content'] ) ) {

‎src/wp-includes/class-wp-http.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,8 @@ public function _get_first_available_transport( $args, $url = null ) {
620620
* @param array $args Request arguments.
621621
* @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'.
622622
* A WP_Error instance upon error.
623+
*
624+
* @phpstan-ignore method.unused (Deprecated in 5.1.0. Core does not remove deprecated methods.)
623625
*/
624626
private function _dispatch_request( $url, $args ) {
625627
static $transports = array();

‎src/wp-includes/class-wp-script-modules.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,8 @@ private function get_loadable_script_module_ids(): array {
787787
*
788788
* @return array<string, array<string, mixed>> Script modules marked for enqueue, keyed by script module identifier.
789789
* @phpstan-return array<string, ScriptModule>
790+
*
791+
* @phpstan-ignore method.unused (Kept for plugins that call it through the Reflection API.)
790792
*/
791793
private function get_marked_for_enqueue(): array {
792794
return wp_array_slice_assoc(

‎tests/phpstan/baselines/method.unused.neon‎

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)