<commit_before><?php
//----------------------------------------------------------------------------------------------------------------------
namespace SetBased\Audit\MySql\Table;

//----------------------------------------------------------------------------------------------------------------------
/**
 * Class for metadata of table columns.
 */
class Columns
{
  //--------------------------------------------------------------------------------------------------------------------
  /**
   * The metadata of the columns.
   *
   * @var array<string,ColumnType>
   */
  private $columns = [];

  //--------------------------------------------------------------------------------------------------------------------
  /**
   * Object constructor.
   *
   * @param array[] $columns The metadata of the columns as returned by DataLayer::getTableColumns().
   */
  public function __construct($columns)
  {
    foreach ($columns as $column)
    {
      if (!is_array($column))
      {
        /** @var ColumnType $column */
        $column = $column->getType();
      }
      /** @var array $column */
      $this->columns[$column['column_name']] = new ColumnType($column);
    }
  }

  //--------------------------------------------------------------------------------------------------------------------
  /**
   * Generate array with audit columns and columns from data table.
   *
   * @param Columns $auditColumnsMetadata   AuditApplication columns for adding to exist columns
   * @param Columns $currentColumnsMetadata Exist table columns
   *
   * @return Columns
   */
  public static function combine($auditColumnsMetadata, $currentColumnsMetadata)
  {
    $columns = [];
<commit_msg>AUD-63: Wrong type or usage of parameter<commit_after><?php
//----------------------------------------------------------------------------------------------------------------------
namespace SetBased\Audit\MySql\Table;

//----------------------------------------------------------------------------------------------------------------------
/**
 * Class for metadata of table columns.
 */
class Columns
{
  //--------------------------------------------------------------------------------------------------------------------
  /**
   * The metadata of the columns.
   *
   * @var array<string,ColumnType>
   */
  private $columns = [];

  //--------------------------------------------------------------------------------------------------------------------
  /**
   * Object constructor.
   *
   * @param array[][] | ColumnType[] $columns The metadata of the columns as returned by DataLayer::getTableColumns().
   */
  public function __construct($columns)
  {
    foreach ($columns as $column)
    {
      if (!is_array($column))
      {
        /** @var ColumnType $column */
        $column = $column->getType();
      }
      /** @var array $column */
      $this->columns[$column['column_name']] = new ColumnType($column);
    }
  }

  //--------------------------------------------------------------------------------------------------------------------
  /**
   * Generate array with audit columns and columns from data table.
   *
   * @param Columns $auditColumnsMetadata   AuditApplication columns for adding to exist columns
   * @param Columns $currentColumnsMetadata Exist table columns
   *
   * @return Columns
   */
  public static function combine($auditColumnsMetadata, $currentColumnsMetadata)
  {
    $columns = [];

{'fraction_non_alphanumeric': 0.4277810133954572, 'fraction_numerical': 0.0005824111822947001, 'mean_word_length': 0.9276094276094277, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1333001', 'n_tokens_mistral': 680, 'n_tokens_neox': 676, 'n_words': 183}