Skip to content

Commit

Permalink
Docs: Improve PHPCS comments general consistency.
Browse files Browse the repository at this point in the history
Props nekojonez.
See #58833.




git-svn-id: https://develop.svn.wordpress.org/trunk@56472 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
audrasjb committed Aug 25, 2023
1 parent 73f7ecc commit e0e36e6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/wp-includes/block-patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,10 @@ function _register_theme_block_patterns() {

// Translate the pattern metadata.
$text_domain = $theme->get( 'TextDomain' );
//phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText, WordPress.WP.I18n.NonSingularStringLiteralContext, WordPress.WP.I18n.NonSingularStringLiteralDomain, WordPress.WP.I18n.LowLevelTranslationFunction
// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText, WordPress.WP.I18n.NonSingularStringLiteralContext, WordPress.WP.I18n.NonSingularStringLiteralDomain, WordPress.WP.I18n.LowLevelTranslationFunction
$pattern_data['title'] = translate_with_gettext_context( $pattern_data['title'], 'Pattern title', $text_domain );
if ( ! empty( $pattern_data['description'] ) ) {
//phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText, WordPress.WP.I18n.NonSingularStringLiteralContext, WordPress.WP.I18n.NonSingularStringLiteralDomain, WordPress.WP.I18n.LowLevelTranslationFunction
// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText, WordPress.WP.I18n.NonSingularStringLiteralContext, WordPress.WP.I18n.NonSingularStringLiteralDomain, WordPress.WP.I18n.LowLevelTranslationFunction
$pattern_data['description'] = translate_with_gettext_context( $pattern_data['description'], 'Pattern description', $text_domain );
}

Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5144,7 +5144,7 @@ function _wp_to_kebab_case( $input_string ) {

preg_match_all( $regexp, str_replace( "'", '', $input_string ), $matches );
return strtolower( implode( '-', $matches[0] ) );
//phpcs:enable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
// phpcs:enable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ function _delete_all_data() {
$wpdb->term_relationships,
$wpdb->termmeta,
) as $table ) {
//phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
$wpdb->query( "DELETE FROM {$table}" );
}

foreach ( array(
$wpdb->terms,
$wpdb->term_taxonomy,
) as $table ) {
//phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
$wpdb->query( "DELETE FROM {$table} WHERE term_id != 1" );
}

Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/includes/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@

$wpdb->query( 'SET foreign_key_checks = 0' );
foreach ( $wpdb->tables() as $table => $prefixed_table ) {
//phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
$wpdb->query( "DROP TABLE IF EXISTS $prefixed_table" );
}

foreach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table ) {
//phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
$wpdb->query( "DROP TABLE IF EXISTS $prefixed_table" );

// We need to create references to ms global tables.
Expand Down
6 changes: 3 additions & 3 deletions tests/phpunit/includes/testcase-xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function normalizeXML( $xml, $options = 0 ) {
* @param string $message Optional. Message to display when the assertion fails.
*/
public function assertXMLEquals( $expectedXml, $actualXml, $message = '' ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
$this->assertSame( $this->normalizeXML( $expectedXml ), $this->normalizeXML( $actualXml ), $message ); //phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
$this->assertSame( $this->normalizeXML( $expectedXml ), $this->normalizeXML( $actualXml ), $message ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
}

/**
Expand All @@ -86,7 +86,7 @@ public function assertXMLEquals( $expectedXml, $actualXml, $message = '' ) { //
* @param string $actualXml
* @param string $message Optional. Message to display when the assertion fails.
*/
public function assertXMLNotEquals( $expectedXml, $actualXml, $message = '' ) { //phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
$this->assertNotEquals( $this->normalizeXML( $expectedXml ), $this->normalizeXML( $actualXml ), $message ); //phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
public function assertXMLNotEquals( $expectedXml, $actualXml, $message = '' ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
$this->assertNotEquals( $this->normalizeXML( $expectedXml ), $this->normalizeXML( $actualXml ), $message ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
}
}

0 comments on commit e0e36e6

Please sign in to comment.