<commit_before><?php

/**
 * @file
 * PublisherAPI Base abstract class.
 */

namespace ChapterThree\AppleNews\PublisherAPI;

/**
 * PublisherAPI Abstract class
 * 
 * @package    ChapterThree\AppleNews\PublisherAPI\Base
 */
abstract class Base {

  /** @var (string) PublisherAPI API Key ID. */
  public $api_key_id = '';

  /** @var (string) PublisherAPI Secret Key. */
  public $api_key_secret = '';

  /** @var (string) PublisherAPI Endpoint base URL. */
  public $endpoint = '';

  /** @var (object) HTTP client class. */
  public $client;

  /** @var (string) Endpoint path. */
  protected $path = '';

  /** @var (string) HTTP Method (GET/DELETE/POST). */
  protected $method = '';

  /** @var (array) Endpoint path variables to replace. */
  protected $path_args = [];

  /** @var (datetime) ISO 8601 datetime. */
  protected $datetime;

  /** @var (array) Valid values for resource part Content-Type. */
  protected $valid_mimes = [
    'image/jpeg',
    'image/png',
    'image/gif',
    'application/octet-stream'
  ];

  /**
   * Initialize variables needed in the communication with the API.
   *
   * @param (string) $key API Key.
   * @param (string) $secret API Secret Key.
   * @param (string) $endpoint API endpoint URL.
   */
  public function __construct($key, $secret, $endpoint) {
    // Set API required variables.
    $this->api_key_id = $key;
    $this->api_key_secret = $secret;
    $this->endpoint = $endpoint;
    // ISO 8601 date and time format.
    $this->datetime = gmdate(\DateTime::ISO8601);
    // Initialize HTTP client.
    $this->SetHTTPClient();
  }

  /**
   * Generate HMAC cryptographic hash.
   *
   * @param (string) $string Message to be hashed.
   * @param (string) $api_key_secret Shared secret key used for generating the HMAC.
   *
   * @return (string) Authorization token used in the HTTP headers.
   */
  final protected function hhmac($string, $api_key_secret) {<commit_msg>Change function to match overall naming convention.<commit_after><?php

/**
 * @file
 * PublisherAPI Base abstract class.
 */

namespace ChapterThree\AppleNews\PublisherAPI;

/**
 * PublisherAPI Abstract class
 * 
 * @package    ChapterThree\AppleNews\PublisherAPI\Base
 */
abstract class Base {

  /** @var (string) PublisherAPI API Key ID. */
  public $api_key_id = '';

  /** @var (string) PublisherAPI Secret Key. */
  public $api_key_secret = '';

  /** @var (string) PublisherAPI Endpoint base URL. */
  public $endpoint = '';

  /** @var (object) HTTP client class. */
  public $client;

  /** @var (string) Endpoint path. */
  protected $path = '';

  /** @var (string) HTTP Method (GET/DELETE/POST). */
  protected $method = '';

  /** @var (array) Endpoint path variables to replace. */
  protected $path_args = [];

  /** @var (datetime) ISO 8601 datetime. */
  protected $datetime;

  /** @var (array) Valid values for resource part Content-Type. */
  protected $valid_mimes = [
    'image/jpeg',
    'image/png',
    'image/gif',
    'application/octet-stream'
  ];

  /**
   * Initialize variables needed in the communication with the API.
   *
   * @param (string) $key API Key.
   * @param (string) $secret API Secret Key.
   * @param (string) $endpoint API endpoint URL.
   */
  public function __construct($key, $secret, $endpoint) {
    // Set API required variables.
    $this->api_key_id = $key;
    $this->api_key_secret = $secret;
    $this->endpoint = $endpoint;
    // ISO 8601 date and time format.
    $this->datetime = gmdate(\DateTime::ISO8601);
    // Initialize HTTP client.
    $this->setHTTPClient();
  }

  /**
   * Generate HMAC cryptographic hash.
   *
   * @param (string) $string Message to be hashed.
   * @param (string) $api_key_secret Shared secret key used for generating the HMAC.
   *
   * @return (string) Authorization token used in the HTTP headers.
   */
  final protected function hhmac($string, $api_key_secret) {
{'fraction_non_alphanumeric': 0.14473007712082261, 'fraction_numerical': 0.006169665809768638, 'mean_word_length': 3.044698544698545, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '4408372', 'n_tokens_mistral': 1246, 'n_tokens_neox': 1190, 'n_words': 362}