Make WordPress Core

Ticket #56791: 56791-always-declare-visibility-for-properties.patch

File 56791-always-declare-visibility-for-properties.patch, 1.8 KB (added by jrf, 17 months ago)

Follow up to previous efforts to make sure visibility is declared on all properties. Note: this will be enforced by WPCS 3.0.0.

  • tests/phpunit/tests/menu/wp-nav-menu.php

    From e87027cd3ca1735ad08a194d023bc2de427553a5 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Mon, 28 Nov 2022 19:04:30 +0100
    Subject: [PATCH] CS: always declare visibility for properties
    
    ---
     tests/phpunit/tests/menu/wp-nav-menu.php   | 10 +++++-----
     tests/phpunit/tests/query/fieldsClause.php |  4 ++--
     2 files changed, 7 insertions(+), 7 deletions(-)
    
    diff --git a/tests/phpunit/tests/menu/wp-nav-menu.php b/tests/phpunit/tests/menu/wp-nav-menu.php
    index a077766567..08f105be9a 100644
    a b  
    77 */
    88class Tests_Menu_wpNavMenu extends WP_UnitTestCase {
    99
    10         static $menu_id        = 0;
    11         static $lvl0_menu_item = 0;
    12         static $lvl1_menu_item = 0;
    13         static $lvl2_menu_item = 0;
    14         static $lvl3_menu_item = 0;
     10        private static $menu_id        = 0;
     11        private static $lvl0_menu_item = 0;
     12        private static $lvl1_menu_item = 0;
     13        private static $lvl2_menu_item = 0;
     14        private static $lvl3_menu_item = 0;
    1515
    1616        public static function set_up_before_class() {
    1717                parent::set_up_before_class();
  • tests/phpunit/tests/query/fieldsClause.php

    diff --git a/tests/phpunit/tests/query/fieldsClause.php b/tests/phpunit/tests/query/fieldsClause.php
    index 87f78a8719..28c040d79c 100644
    a b class Tests_Query_FieldsClause extends WP_UnitTestCase { 
    1111         *
    1212         * @var int[]
    1313         */
    14         static $post_ids = array();
     14        private static $post_ids = array();
    1515
    1616        /**
    1717         * Page IDs.
    1818         *
    1919         * @var int[]
    2020         */
    21         static $page_ids = array();
     21        private static $page_ids = array();
    2222
    2323        public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
    2424                // Register CPT for use with shared fixtures.