From 9726aaba5d706988c52eaaf2c1e40a42bfbc9e23 Mon Sep 17 00:00:00 2001
From: Marco Martins <marcomartins@fimdalinha.com>
Date: Fri, 13 Apr 2018 17:33:32 +0300
Subject: [PATCH] Fix CS violations for admin-header.php

---
 src/wp-admin/admin-header.php | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/wp-admin/admin-header.php b/src/wp-admin/admin-header.php
index 5322e2bb65..9cb7c85943 100644
--- a/src/wp-admin/admin-header.php
+++ b/src/wp-admin/admin-header.php
@@ -6,7 +6,8 @@
  * @subpackage Administration
  */
 
-@header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
+// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
+ @header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
 if ( ! defined( 'WP_ADMIN' ) ) {
 	require_once( dirname( __FILE__ ) . '/admin.php' );
 }
@@ -32,6 +33,7 @@ if ( empty( $current_screen ) ) {
 }
 
 get_admin_page_title();
+// phpcs:ignore WordPress.Variables.GlobalVariables.OverrideProhibited -- allow existing globals
 $title = esc_html( strip_tags( $title ) );
 
 if ( is_network_admin() ) {
@@ -98,12 +100,14 @@ var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
  */
 do_action( 'admin_enqueue_scripts', $hook_suffix );
 
+// phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores -- allow for dash for dynamic hooks
 /**
  * Fires when styles are printed for a specific admin page based on $hook_suffix.
  *
  * @since 2.6.0
  */
 do_action( "admin_print_styles-{$hook_suffix}" );
+// phpcs:enable
 
 /**
  * Fires when styles are printed for all admin pages.
@@ -112,12 +116,14 @@ do_action( "admin_print_styles-{$hook_suffix}" );
  */
 do_action( 'admin_print_styles' );
 
+// phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores -- allow for dash for dynamic hooks
 /**
  * Fires when scripts are printed for a specific admin page based on $hook_suffix.
  *
  * @since 2.1.0
  */
 do_action( "admin_print_scripts-{$hook_suffix}" );
+//phpcs:enable
 
 /**
  * Fires when scripts are printed for all admin pages.
@@ -126,6 +132,7 @@ do_action( "admin_print_scripts-{$hook_suffix}" );
  */
 do_action( 'admin_print_scripts' );
 
+// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores -- allow for dash for dynamic hooks
 /**
  * Fires in head section for a specific admin page.
  *
@@ -135,6 +142,7 @@ do_action( 'admin_print_scripts' );
  * @since 2.1.0
  */
 do_action( "admin_head-{$hook_suffix}" );
+// phpcs:enable
 
 /**
  * Fires in head section for all admin pages.
@@ -274,6 +282,6 @@ if ( is_network_admin() ) {
  */
 do_action( 'all_admin_notices' );
 
-if ( $parent_file == 'options-general.php' ) {
+if ( 'options-general.php' === $parent_file ) {
 	require( ABSPATH . 'wp-admin/options-head.php' );
 }
-- 
2.11.0 (Apple Git-81)

