Skip to content

Commit

Permalink
Update PHP Code Sniffer suppression annotations
Browse files Browse the repository at this point in the history
This commit updates the PHP Code Sniffer suppression annotations in the apple-exporter components class. Previously, there was an incorrect ignore annotation `VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable` in `node_matches` method which has now been replaced with `Generic.CodeAnalysis.UnusedFunctionParameter.Found`. This change better reflects the actual warning being suppressed.

Also, a new annotation for `WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase` has been added around the method for finding iframe nodes in
  • Loading branch information
attackant committed Oct 31, 2023
1 parent f59d6be commit b2ce921
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion includes/apple-exporter/components/class-component.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public function __construct(
* @access public
* @return \DOMElement|null The node on success, or null on no match.
*/
public static function node_matches( $node ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
public static function node_matches( $node ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found
return null;
}

Expand Down Expand Up @@ -777,6 +777,7 @@ protected static function url_from_src( $html ) {
return '';
}

/* phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase */
/**
* Given a DOMElement, recursively traverses its children looking for iframe
* nodes and returns the first one it finds.
Expand Down Expand Up @@ -840,4 +841,5 @@ public static function is_embed_figure( $node ) {

return $has_figure_iframe;
}
/* phpcs:enable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase */
}

0 comments on commit b2ce921

Please sign in to comment.