|
24 | 24 | * |
25 | 25 | * @access private |
26 | 26 | */ |
27 | | -class WP_Settings_Abilities { |
| 27 | +final class WP_Settings_Abilities { |
28 | 28 |
|
29 | 29 | /** |
30 | 30 | * The ability category used for settings abilities. |
31 | 31 | * |
32 | 32 | * @since 7.1.0 |
33 | 33 | * @var string |
34 | 34 | */ |
35 | | - const CATEGORY = 'site'; |
| 35 | + private const CATEGORY = 'site'; |
36 | 36 |
|
37 | 37 | /** |
38 | 38 | * Settings exposed through the Abilities API, computed once at registration. |
@@ -68,7 +68,7 @@ public static function register(): void { |
68 | 68 | * |
69 | 69 | * @since 7.1.0 |
70 | 70 | */ |
71 | | - public static function register_get_settings(): void { |
| 71 | + private static function register_get_settings(): void { |
72 | 72 | // Compute once; execute_get_settings() reuses this exact structure. |
73 | 73 | self::$exposed_settings = self::get_exposed_settings(); |
74 | 74 |
|
@@ -173,7 +173,7 @@ public static function has_permission(): bool { |
173 | 173 | * @param list<string> $field_names Available exposed setting names. |
174 | 174 | * @return array<string, mixed> The input JSON Schema. |
175 | 175 | */ |
176 | | - protected static function get_settings_input_schema( array $groups, array $field_names ): array { |
| 176 | + private static function get_settings_input_schema( array $groups, array $field_names ): array { |
177 | 177 | return array( |
178 | 178 | 'type' => 'object', |
179 | 179 | // Object (not array()) so the serialized schema default is {}, consistent with type:object. |
@@ -209,7 +209,7 @@ protected static function get_settings_input_schema( array $groups, array $field |
209 | 209 | * |
210 | 210 | * @return array<string, array{option: string, group: string, default: mixed, schema: array<string, mixed>}> Settings keyed by exposed name. |
211 | 211 | */ |
212 | | - protected static function get_exposed_settings(): array { |
| 212 | + private static function get_exposed_settings(): array { |
213 | 213 | $settings = array(); |
214 | 214 |
|
215 | 215 | foreach ( get_registered_settings() as $option_name => $args ) { |
@@ -241,7 +241,7 @@ protected static function get_exposed_settings(): array { |
241 | 241 | * @param bool|array<string, mixed> $show The setting's `show_in_abilities` value. |
242 | 242 | * @return array<string, mixed> The value JSON Schema. |
243 | 243 | */ |
244 | | - protected static function value_schema( array $args, $show ): array { |
| 244 | + private static function value_schema( array $args, $show ): array { |
245 | 245 | $schema = array( |
246 | 246 | 'type' => isset( $args['type'] ) && is_string( $args['type'] ) ? $args['type'] : 'string', |
247 | 247 | ); |
@@ -269,7 +269,7 @@ protected static function value_schema( array $args, $show ): array { |
269 | 269 | * @param string $type The registered setting type. |
270 | 270 | * @return mixed The value cast to the declared type. |
271 | 271 | */ |
272 | | - protected static function cast_value( $value, string $type ) { |
| 272 | + private static function cast_value( $value, string $type ) { |
273 | 273 | switch ( $type ) { |
274 | 274 | case 'boolean': |
275 | 275 | return (bool) $value; |
|
0 commit comments