28 public function validate( $name, $value, array $settings, array $options ) {
29 if ( is_bool( $value ) ) {
31 } elseif ( $options[ self::OPT_ENFORCE_JSON_TYPES ] ??
false ) {
34 ->params( gettype( $value ) ),
35 $name, $value, $settings, $options
39 $value = strtolower( $value );
40 if ( in_array( $value, self::TRUEVALS,
true ) ) {
43 if ( $value ===
'' || in_array( $value, self::FALSEVALS,
true ) ) {
49 ->textListParams( array_map( [ $this,
'quoteVal' ], self::TRUEVALS ) )
50 ->numParams( count( self::TRUEVALS ) )
51 ->textListParams( array_merge(
52 array_map( [ $this,
'quoteVal' ], self::FALSEVALS ),
53 [ MessageValue::new(
'paramvalidator-emptystring' ) ]
55 ->numParams( count( self::FALSEVALS ) + 1 ),
56 $name, $value, $settings, $options