Skip to content

Commit 5bad4e7

Browse files
Code Modernization: Use explicit visibility for class property declarations.
Using `var` or only `static` to declare a class property is PHP 4 code. This updates the codebase to use explicit visibility modifiers introduced in PHP 5. Props jrf. Fixes #51557. See #22234. git-svn-id: https://develop.svn.wordpress.org/trunk@49184 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 5b6a20a commit 5bad4e7

38 files changed

Lines changed: 121 additions & 121 deletions

src/wp-content/themes/twentynineteen/classes/class-twentynineteen-svg-icons.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public static function get_social_link_svg( $uri, $size ) {
7070
*
7171
* @var array
7272
*/
73-
static $ui_icons = array(
73+
public static $ui_icons = array(
7474
'link' => /* material-design – link */ '
7575
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
7676
<path d="M0 0h24v24H0z" fill="none"></path>
@@ -178,7 +178,7 @@ public static function get_social_link_svg( $uri, $size ) {
178178
*
179179
* @var array
180180
*/
181-
static $social_icons_map = array(
181+
public static $social_icons_map = array(
182182
'amazon' => array(
183183
'amazon.com',
184184
'amazon.cn',
@@ -237,7 +237,7 @@ public static function get_social_link_svg( $uri, $size ) {
237237
*
238238
* @var array
239239
*/
240-
static $social_icons = array(
240+
public static $social_icons = array(
241241
'500px' => '
242242
<svg viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
243243
<path d="M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z"></path>

src/wp-includes/class-wp-rewrite.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -45,55 +45,55 @@ class WP_Rewrite {
4545
* @since 1.5.0
4646
* @var string
4747
*/
48-
var $author_base = 'author';
48+
public $author_base = 'author';
4949

5050
/**
5151
* Permalink structure for author archives.
5252
*
5353
* @since 1.5.0
5454
* @var string
5555
*/
56-
var $author_structure;
56+
public $author_structure;
5757

5858
/**
5959
* Permalink structure for date archives.
6060
*
6161
* @since 1.5.0
6262
* @var string
6363
*/
64-
var $date_structure;
64+
public $date_structure;
6565

6666
/**
6767
* Permalink structure for pages.
6868
*
6969
* @since 1.5.0
7070
* @var string
7171
*/
72-
var $page_structure;
72+
public $page_structure;
7373

7474
/**
7575
* Base of the search permalink structure (example.com/$search_base/query).
7676
*
7777
* @since 1.5.0
7878
* @var string
7979
*/
80-
var $search_base = 'search';
80+
public $search_base = 'search';
8181

8282
/**
8383
* Permalink structure for searches.
8484
*
8585
* @since 1.5.0
8686
* @var string
8787
*/
88-
var $search_structure;
88+
public $search_structure;
8989

9090
/**
9191
* Comments permalink base.
9292
*
9393
* @since 1.5.0
9494
* @var string
9595
*/
96-
var $comments_base = 'comments';
96+
public $comments_base = 'comments';
9797

9898
/**
9999
* Pagination permalink base.
@@ -109,31 +109,31 @@ class WP_Rewrite {
109109
* @since 4.2.0
110110
* @var string
111111
*/
112-
var $comments_pagination_base = 'comment-page';
112+
public $comments_pagination_base = 'comment-page';
113113

114114
/**
115115
* Feed permalink base.
116116
*
117117
* @since 1.5.0
118118
* @var string
119119
*/
120-
var $feed_base = 'feed';
120+
public $feed_base = 'feed';
121121

122122
/**
123123
* Comments feed permalink structure.
124124
*
125125
* @since 1.5.0
126126
* @var string
127127
*/
128-
var $comment_feed_structure;
128+
public $comment_feed_structure;
129129

130130
/**
131131
* Feed request permalink structure.
132132
*
133133
* @since 1.5.0
134134
* @var string
135135
*/
136-
var $feed_structure;
136+
public $feed_structure;
137137

138138
/**
139139
* The static portion of the post permalink structure.
@@ -178,15 +178,15 @@ class WP_Rewrite {
178178
* @since 1.5.0
179179
* @var string
180180
*/
181-
var $matches = '';
181+
public $matches = '';
182182

183183
/**
184184
* Rewrite rules to match against the request to find the redirect or query.
185185
*
186186
* @since 1.5.0
187187
* @var array
188188
*/
189-
var $rules;
189+
public $rules;
190190

191191
/**
192192
* Additional rules added external to the rewrite class.
@@ -196,7 +196,7 @@ class WP_Rewrite {
196196
* @since 2.1.0
197197
* @var array
198198
*/
199-
var $extra_rules = array();
199+
public $extra_rules = array();
200200

201201
/**
202202
* Additional rules that belong at the beginning to match first.
@@ -206,7 +206,7 @@ class WP_Rewrite {
206206
* @since 2.3.0
207207
* @var array
208208
*/
209-
var $extra_rules_top = array();
209+
public $extra_rules_top = array();
210210

211211
/**
212212
* Rules that don't redirect to WordPress' index.php.
@@ -217,23 +217,23 @@ class WP_Rewrite {
217217
* @since 2.1.0
218218
* @var array
219219
*/
220-
var $non_wp_rules = array();
220+
public $non_wp_rules = array();
221221

222222
/**
223223
* Extra permalink structures, e.g. categories, added by add_permastruct().
224224
*
225225
* @since 2.1.0
226226
* @var array
227227
*/
228-
var $extra_permastructs = array();
228+
public $extra_permastructs = array();
229229

230230
/**
231231
* Endpoints (like /trackback/) added by add_rewrite_endpoint().
232232
*
233233
* @since 2.1.0
234234
* @var array
235235
*/
236-
var $endpoints;
236+
public $endpoints;
237237

238238
/**
239239
* Whether to write every mod_rewrite rule for WordPress into the .htaccess file.
@@ -277,7 +277,7 @@ class WP_Rewrite {
277277
* @since 1.5.0
278278
* @var array
279279
*/
280-
var $rewritecode = array(
280+
public $rewritecode = array(
281281
'%year%',
282282
'%monthnum%',
283283
'%day%',
@@ -298,7 +298,7 @@ class WP_Rewrite {
298298
* @since 1.5.0
299299
* @var array
300300
*/
301-
var $rewritereplace = array(
301+
public $rewritereplace = array(
302302
'([0-9]{4})',
303303
'([0-9]{1,2})',
304304
'([0-9]{1,2})',
@@ -318,7 +318,7 @@ class WP_Rewrite {
318318
* @since 1.5.0
319319
* @var array
320320
*/
321-
var $queryreplace = array(
321+
public $queryreplace = array(
322322
'year=',
323323
'monthnum=',
324324
'day=',

src/wp-includes/pomo/entry.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ class Translation_Entry {
1818
*
1919
* @var boolean
2020
*/
21-
var $is_plural = false;
21+
public $is_plural = false;
2222

23-
var $context = null;
24-
var $singular = null;
25-
var $plural = null;
26-
var $translations = array();
27-
var $translator_comments = '';
28-
var $extracted_comments = '';
29-
var $references = array();
30-
var $flags = array();
23+
public $context = null;
24+
public $singular = null;
25+
public $plural = null;
26+
public $translations = array();
27+
public $translator_comments = '';
28+
public $extracted_comments = '';
29+
public $references = array();
30+
public $flags = array();
3131

3232
/**
3333
* @param array $args associative array, support following keys:

src/wp-includes/pomo/mo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
if ( ! class_exists( 'MO', false ) ) :
1414
class MO extends Gettext_Translations {
1515

16-
var $_nplurals = 2;
16+
public $_nplurals = 2;
1717

1818
/**
1919
* Loaded MO file.

src/wp-includes/pomo/po.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
if ( ! class_exists( 'PO', false ) ) :
2222
class PO extends Gettext_Translations {
2323

24-
var $comments_before_headers = '';
24+
public $comments_before_headers = '';
2525

2626
/**
2727
* Exports headers to a PO entry

src/wp-includes/pomo/streams.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
if ( ! class_exists( 'POMO_Reader', false ) ) :
1212
class POMO_Reader {
1313

14-
var $endian = 'little';
15-
var $_post = '';
14+
public $endian = 'little';
15+
public $_post = '';
1616

1717
/**
1818
* PHP5 constructor.
@@ -226,7 +226,7 @@ function read_all() {
226226
*/
227227
class POMO_StringReader extends POMO_Reader {
228228

229-
var $_str = '';
229+
public $_str = '';
230230

231231
/**
232232
* PHP5 constructor.

src/wp-includes/pomo/translations.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
if ( ! class_exists( 'Translations', false ) ) :
1414
class Translations {
15-
var $entries = array();
16-
var $headers = array();
15+
public $entries = array();
16+
public $headers = array();
1717

1818
/**
1919
* Add entry to the PO structure
@@ -301,8 +301,8 @@ function set_header( $header, $value ) {
301301
* Provides the same interface as Translations, but doesn't do anything
302302
*/
303303
class NOOP_Translations {
304-
var $entries = array();
305-
var $headers = array();
304+
public $entries = array();
305+
public $headers = array();
306306

307307
function add_entry( $entry ) {
308308
return true;

0 commit comments

Comments
 (0)