=> */ protected $target_functions = array( 'add_menu_page' => array( 4 ), 'add_object_page' => array( 4 ), 'add_utility_page' => array( 4 ), 'add_submenu_page' => array( 1, 5 ), 'add_dashboard_page' => array( 4 ), 'add_posts_page' => array( 4 ), 'add_media_page' => array( 4 ), 'add_links_page' => array( 4 ), 'add_pages_page' => array( 4 ), 'add_comments_page' => array( 4 ), 'add_theme_page' => array( 4 ), 'add_plugins_page' => array( 4 ), 'add_users_page' => array( 4 ), 'add_management_page' => array( 4 ), 'add_options_page' => array( 4 ), ); /** * Process the parameters of a matched function. * * @since 0.11.0 * * @param int $stackPtr The position of the current token in the stack. * @param string $group_name The name of the group which was matched. * @param string $matched_content The token content (function name) which was matched. * @param array $parameters Array with information about the parameters. * * @return void */ public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { foreach ( $this->target_functions[ $matched_content ] as $position ) { if ( isset( $parameters[ $position ] ) ) { $file_constant = $this->phpcsFile->findNext( \T_FILE, $parameters[ $position ]['start'], ( $parameters[ $position ]['end'] + 1 ) ); if ( false !== $file_constant ) { $this->phpcsFile->addWarning( 'Using __FILE__ for menu slugs risks exposing filesystem structure.', $stackPtr, 'Using__FILE__' ); } } } } }