PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.1
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.1
16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 All 504 releases
← All changes | modules/tiled-gallery/math/class-constrained-array-rounding.php +4 -10 12.2.3 → 16.3-a.1 View file →
@@ -68,9 +68,9 @@
68 68 * @param array $bound_array_int - the array we're adjusting.
69 69 * @param int $adjustment - how much we're adjusting the array.
70 70 */
71 71 private static function adjust_constrained_array( &$bound_array_int, $adjustment ) {
72 - usort( $bound_array_int, array( 'self', 'cmp_desc_fraction' ) );
72 + usort( $bound_array_int, array( self::class, 'cmp_desc_fraction' ) );
73 73
74 74 $start = 0;
75 75 $end = $adjustment - 1;
76 76 $length = count( $bound_array_int );
@@ -78,9 +78,9 @@
78 78 for ( $i = $start; $i <= $end; $i++ ) {
79 79 ++$bound_array_int[ $i % $length ]['floor'];
80 80 }
81 81
82 - usort( $bound_array_int, array( 'self', 'cmp_asc_index' ) );
82 + usort( $bound_array_int, array( self::class, 'cmp_asc_index' ) );
83 83 }
84 84
85 85 /**
86 86 * Compare fraction values of two arrays.
@@ -90,12 +90,9 @@
90 90 *
91 91 * @return int
92 92 */
93 93 private static function cmp_desc_fraction( $a, $b ) {
94 - if ( $a['fraction'] === $b['fraction'] ) {
95 - return 0;
96 - }
97 - return $a['fraction'] > $b['fraction'] ? -1 : 1;
94 + return $b['fraction'] <=> $a['fraction'];
98 95 }
99 96
100 97 /**
101 98 * Compare index values of two arrays.
@@ -105,10 +102,7 @@
105 102 *
106 103 * @return int
107 104 */
108 105 private static function cmp_asc_index( $a, $b ) {
109 - if ( $a['index'] === $b['index'] ) {
110 - return 0;
111 - }
112 - return $a['index'] < $b['index'] ? -1 : 1;
106 + return $a['index'] <=> $b['index'];
113 107 }
114 108 }