Skip to content

Commit

Permalink
CS: minor tweaks to comply with WordPressCS 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Dec 14, 2023
1 parent 3b2dd8d commit f31de12
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/BrainMonkey/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ public function stubTranslationFunctions() {
[
'__' => null,
'_x' => null,
'_n' => static function( $single, $plural, $number ) {
'_n' => static function ( $single, $plural, $number ) {
return ( $number === 1 ) ? $single : $plural;
},
'_nx' => static function( $single, $plural, $number ) {
'_nx' => static function ( $single, $plural, $number ) {
return ( $number === 1 ) ? $single : $plural;
},
'translate' => null,
Expand Down
10 changes: 5 additions & 5 deletions src/BrainMonkey/YoastTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected function set_up() {
Monkey\Functions\stubs(
[
// Passing "null" makes the function return it's first argument.
'get_bloginfo' => static function( $show ) {
'get_bloginfo' => static function ( $show ) {
switch ( $show ) {
case 'charset':
return 'UTF-8';
Expand All @@ -34,14 +34,14 @@ protected function set_up() {

return $show;
},
'is_multisite' => static function() {
'is_multisite' => static function () {
if ( \defined( 'WP_TESTS_MULTISITE' ) ) {
return (bool) \WP_TESTS_MULTISITE;
}

return false;
},
'mysql2date' => static function( $format, $date ) {
'mysql2date' => static function ( $format, $date ) {
return $date;
},
'number_format_i18n' => null,
Expand All @@ -51,7 +51,7 @@ protected function set_up() {
'wp_parse_args' => static function ( $args, $defaults ) {
return \array_merge( $defaults, $args );
},
'wp_strip_all_tags' => static function( $text, $remove_breaks = false ) {
'wp_strip_all_tags' => static function ( $text, $remove_breaks = false ) {
$text = \preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $text );
$text = \strip_tags( $text );

Expand All @@ -62,7 +62,7 @@ protected function set_up() {
return \trim( $text );
},
'wp_slash' => null,
'wp_unslash' => static function( $value ) {
'wp_unslash' => static function ( $value ) {
return \is_string( $value ) ? \stripslashes( $value ) : $value;
},
]
Expand Down
1 change: 0 additions & 1 deletion src/WPIntegration/TestCaseNoPolyfills.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@
abstract class TestCase extends WP_UnitTestCase {

use ExpectOutputHelper;

}
2 changes: 1 addition & 1 deletion src/WPIntegration/bootstrap-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function get_path_to_wp_test_dir() {
*
* @return string The file path with normalized slashes.
*/
$normalize_path = static function( $path ) {
$normalize_path = static function ( $path ) {
return \str_replace( '\\', '/', $path );
};

Expand Down

0 comments on commit f31de12

Please sign in to comment.