: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Contactable\SWV;
class RequiredFileRule extends Rule {
const rule_name = 'requiredfile';
public function matches( $context ) {
if ( false === parent::matches( $context ) ) {
if ( empty( $context['file'] ) ) {
public function validate( $context ) {
$field = $this->get_property( 'field' );
$input = $_FILES[$field]['tmp_name'] ?? '';
$input = wpcf7_array_flatten( $input );
$input = wpcf7_exclude_blank( $input );
return $this->create_error();