Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CS: minor tweaks to comply with WordPressCS 3.0 #72

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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