<commit_before><?php

final class DiffusionMergedCommitsQueryConduitAPIMethod
  extends DiffusionQueryConduitAPIMethod {

  public function getAPIMethodName() {
    return 'diffusion.mergedcommitsquery';
  }

  public function getMethodDescription() {
    return
      'Merged commit information for a specific commit in a repository.';
  }

  protected function defineReturnType() {
    return 'array';
  }

  protected function defineCustomParamTypes() {
    return array(
      'commit' => 'required string',
      'limit' => 'optional int',
    );
  }

  private function getLimit(ConduitAPIRequest $request) {
    return $request->getValue('limit', PHP_INT_MAX);
  }

  protected function getGitResult(ConduitAPIRequest $request) {
    $drequest = $this->getDiffusionRequest();
    $repository = $drequest->getRepository();
    $commit = $request->getValue('commit');
    $limit = $this->getLimit($request);<commit_msg>Fix a bug with DiffusionMergedCommitsQueryConduitAPIMethod<commit_after><?php

final class DiffusionMergedCommitsQueryConduitAPIMethod
  extends DiffusionQueryConduitAPIMethod {

  public function getAPIMethodName() {
    return 'diffusion.mergedcommitsquery';
  }

  public function getMethodDescription() {
    return
      'Merged commit information for a specific commit in a repository.';
  }

  protected function defineReturnType() {
    return 'array';
  }

  protected function defineCustomParamTypes() {
    return array(
      'commit' => 'required string',
      'limit' => 'optional int',
    );
  }

  private function getLimit(ConduitAPIRequest $request) {
    // TODO: Paginate this sensibly at some point.
    return $request->getValue('limit', 4096);
  }

  protected function getGitResult(ConduitAPIRequest $request) {
    $drequest = $this->getDiffusionRequest();
    $repository = $drequest->getRepository();
    $commit = $request->getValue('commit');
    $limit = $this->getLimit($request);
{'fraction_non_alphanumeric': 0.10841507485802789, 'fraction_numerical': 0.002065049044914817, 'mean_word_length': 4.266304347826087, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '5047416', 'n_tokens_mistral': 557, 'n_tokens_neox': 552, 'n_words': 130}