original_string: private static function required_params_exist( $type, $data ) {
  
  		$required = [ 'name', 'slug' ];
  
  		if ( 'submenu' === $type ) {
  			array_push( $required, 'parent' );
  		}
  
  		foreach ( $required as $field ) {
  			if ( ! isset( $data[ $field ] ) || empty( $data[ $field ] ) ) {
  				return false;
  			}
  		}
  
  		return true;
  	}
code: private static function required_params_exist( $type, $data ) {
  
  		$required = [ 'name', 'slug' ];
  
  		if ( 'submenu' === $type ) {
  			array_push( $required, 'parent' );
  		}
  
  		foreach ( $required as $field ) {
  			if ( ! isset( $data[ $field ] ) || empty( $data[ $field ] ) ) {
  				return false;
  			}
  		}
  
  		return true;
  	}
code_tokens: private static function required_params_exist ( $ type , $ data ) { $ required = [ 'name' , 'slug' ] ; if ( 'submenu' === $ type ) { array_push ( $ required , 'parent' ) ; } foreach ( $ required as $ field ) { if ( ! isset ( $ data [ $ field ] ) || empty ( $ data [ $ field ] ) ) { return false ; } } return true ; }
docstring: Validate if the required parameters exist.
  
  @since 1.0.4
  
  @param string $type → menu | submenu.
  @param array  $data → settings.
  
  @return boolean
docstring_tokens: Validate if the required parameters exist .