Skip to content

Commit

Permalink
Merge pull request #72 from Yoast/JRF/cs-minor-tweaks
Browse files Browse the repository at this point in the history
CS: minor tweaks to comply with WordPressCS 3.0
  • Loading branch information
jrfnl authored Dec 14, 2023
2 parents 3b2dd8d + f31de12 commit d0a8e4c
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 d0a8e4c

Please sign in to comment.