Skip to content

Commit

Permalink
Cleanup PHP Codesniffer warnings and enable fail (#26516)
Browse files Browse the repository at this point in the history
* Cleanup and enable unused variable warning

- Removes flag ignore warnings in composer.json
- Fixes Unused variable warnings

Most cases were: `foreach ( $some_array as $key => $value )`
with the $key value not being used. If ommited the foreach
will just set the value and ignore the key.

* Remove unsed gloal

* Fix lint alignment
  • Loading branch information
mkaz authored Jun 19, 2021
1 parent 7647ac5 commit ef4d395
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"scripts": {
"format": "phpcbf --standard=phpcs.xml.dist --report-summary --report-source",
"lint": "phpcs --standard=phpcs.xml.dist --runtime-set ignore_warnings_on_exit 1",
"lint": "phpcs --standard=phpcs.xml.dist",
"test": "phpunit",
"test:watch": "phpunit-watcher watch < /dev/tty"
}
Expand Down
2 changes: 0 additions & 2 deletions lib/widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ function gutenberg_use_widgets_block_editor() {
* @return array Legacy widget settings.
*/
function gutenberg_get_legacy_widget_settings() {
global $wp_widget_factory;

$settings = array();

$widget_types_to_hide_from_legacy_widget_block = apply_filters(
Expand Down
10 changes: 5 additions & 5 deletions packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ function render_classic_location_menu( $location, $attributes ) {

return wp_nav_menu(
array(
'theme_location' => $location,
'container' => '',
'items_wrap' => '%3$s',
'fallback_cb' => false,
'echo' => false,
'theme_location' => $location,
'container' => '',
'items_wrap' => '%3$s',
'fallback_cb' => false,
'echo' => false,
)
);
}
Expand Down

0 comments on commit ef4d395

Please sign in to comment.