<commit_before><?php

/**
 * ---------------------------------------------------------------------------------------------
 * WP_Taxonomy
 * ---------------------------------------------------------------------------------------------
 *
 */
abstract class WP_Taxonomy
{
  // -------------------------------------------------------------------------------------------
  // Variables
  // -------------------------------------------------------------------------------------------

  /**
   * @var  string  The name of the taxonomy.
   *
   */
  public $name = '';


  /**
   * @var  bool  Whether this is a hierarchical taxonomy.
   *
   */
  public $hierarchical = false;


  /**
   * @var  array  The object/post types this taxonomy is registered for.
   */
  protected $post_types = [];


  /**
   * @var  array  The arguments used to construct the taxonomy.
   *
   */
  protected $args = [];

  // -------------------------------------------------------------------------------------------


  // -------------------------------------------------------------------------------------------
  // Setup
  // -------------------------------------------------------------------------------------------

  /**
   * __construct( ... )
   *
   * Sets argument list for registering the taxonomy and adds the init hook to do the actual registration.
   * @param  string  $singular      The singular of the taxonomy name, marked for l10n.
   * @param  string  $plural        The plural of the taxonomy name, marked for l10n.
   *                                categories) or not (like tags).
   * @param  bool    $custom_cb     If set to TRUE, will use this class's render_meta_box()
   *                                function instead of using the default UI.
   * @param  array   $extra_args    Additional arguments; these will override any auto-generated
   *                                arguments.
   *
   * @link   http://codex.wordpress.org/Function_Reference/register_taxonomy
   *
   */
  public final function __construct( $singular, $plural, $custom_cb = false, $extra_args = [] )
  {
    // Set standard labels.
    $labels = [
      'name'          => $plural,
      'singular_name' => $singular,
      'menu_name'     => $plural,
      'all_items'     => sprintf( __( 'All %s' ), $plural ),
      'edit_item'     => sprintf( __( 'Edit %s' ), $singular ),
      'view_item'     => sprintf( __( 'View %s' ), $singular ),
      'update_item'   => sprintf( __( 'Update %s' ), $singular ),
      'add_new_item'  => sprintf( __( 'Add New %s' ), $singular ),
      'new_item_name' => sprintf( __( 'New %s Name' ), $singular ),
      'search_items'  => sprintf( __( 'Search %s' ), $plural )
    ];

    // Set specific labels for hierarchical/non-hierarchical use.
    if ( $this->hierarchical )
    {
      $labels = array_replace_recursive( $labels, [
        'parent_item'       => sprintf( __( 'Parent %s' ), $singular ),
        'parent_item_colon' => sprintf( __( 'Parent %s:' ), $singular )
      ] );
    }
    else<commit_msg>Require tax name to be passed to constructor<commit_after><?php

/**
 * ---------------------------------------------------------------------------------------------
 * WP_Taxonomy
 * ---------------------------------------------------------------------------------------------
 *
 */
abstract class WP_Taxonomy
{
  // -------------------------------------------------------------------------------------------
  // Variables
  // -------------------------------------------------------------------------------------------

  /**
   * @var  string  The name of the taxonomy.
   *
   */
  public $name = '';


  /**
   * @var  bool  Whether this is a hierarchical taxonomy.
   *
   */
  public $hierarchical = false;


  /**
   * @var  array  The object/post types this taxonomy is registered for.
   */
  protected $post_types = [];


  /**
   * @var  array  The arguments used to construct the taxonomy.
   *
   */
  protected $args = [];

  // -------------------------------------------------------------------------------------------


  // -------------------------------------------------------------------------------------------
  // Setup
  // -------------------------------------------------------------------------------------------

  /**
   * __construct( ... )
   *
   * Sets argument list for registering the taxonomy and adds the init hook to do the actual registration.
   *
   * @param  string  $name          The name of the taxonomy; corresponds to the first argument of
   *                                register_taxonomy().
   * @param  string  $singular      The singular of the taxonomy name, marked for l10n.
   * @param  string  $plural        The plural of the taxonomy name, marked for l10n.
   *                                categories) or not (like tags).
   * @param  bool    $custom_cb     If set to TRUE, will use this class's render_meta_box()
   *                                function instead of using the default UI.
   * @param  array   $extra_args    Additional arguments; these will override any auto-generated
   *                                arguments.
   *
   * @link   http://codex.wordpress.org/Function_Reference/register_taxonomy
   *
   */
  public final function __construct( $name, $singular, $plural, $custom_cb = false, $extra_args = [] )
  {
    // Set the taxonomy name.
    $this->name = $name;

    // Set standard labels.
    $labels = [
      'name'          => $plural,
      'singular_name' => $singular,
      'menu_name'     => $plural,
      'all_items'     => sprintf( __( 'All %s' ), $plural ),
      'edit_item'     => sprintf( __( 'Edit %s' ), $singular ),
      'view_item'     => sprintf( __( 'View %s' ), $singular ),
      'update_item'   => sprintf( __( 'Update %s' ), $singular ),
      'add_new_item'  => sprintf( __( 'Add New %s' ), $singular ),
      'new_item_name' => sprintf( __( 'New %s Name' ), $singular ),
      'search_items'  => sprintf( __( 'Search %s' ), $plural )
    ];

    // Set specific labels for hierarchical/non-hierarchical use.
    if ( $this->hierarchical )
    {
      $labels = array_replace_recursive( $labels, [
        'parent_item'       => sprintf( __( 'Parent %s' ), $singular ),
        'parent_item_colon' => sprintf( __( 'Parent %s:' ), $singular )
      ] );
    }
    else
{'fraction_non_alphanumeric': 0.3082267487762514, 'fraction_numerical': 0.0012632243802305385, 'mean_word_length': 1.1297915265635508, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3382579', 'n_tokens_mistral': 1627, 'n_tokens_neox': 1590, 'n_words': 442}