21 public function __construct( array $params ) {
22 $this->search = $params[
'search'] ??
null;
23 $this->replace = $params[
'replace'] ??
null;
24 if ( !is_string( $this->search ) ) {
25 throw new InvalidArgumentException(
'`search` is not a string' );
28 if ( !is_string( $this->replace ) ) {
29 throw new InvalidArgumentException(
'`replace` is not a string' );
36 if ( strpos( $message->
translation(), $this->search ) !==
false ) {
40 'translate-checks-replacement',
42 [
'PLAIN', $this->search ],
43 [
'PLAIN', $this->replace ],
47 $issues->add( $issue );