Closed manooweb closed 6 months ago
Hello! PHPStan wants you to provide array[]-s only or strings only. But WordPress is liberal.
Hello! PHPStan wants you to provide array[]-s only or strings only. But WordPress is liberal.
I was inspired by https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/functions.php#L6066-L6076 😑😁
<?php
$message = wp_kses(
__( 'something goes wrong with wp_kses documentation.', 'mydomain' ),
array(
'a' => array( 'href' => true ),
'br' => array(),
'code' => array(),
'em' => array(),
)
);
works perfectly.
Thanks
wp_kses()
$allowed_html
second parameter is documented asarray[]|string
https://github.com/WordPress/wordpress-develop/blob/6.4/src/wp-includes/kses.php#L740With the code below, it seems ok for us
but PHPStan returns
With the other one
PHPStan returns
Is there something we are missing?
Thanks.