<commit_before><?php
/* This class is part of the XP framework
 *
 * $Id$
 */

  uses('net.xp_forge.examples.AbstractExampleCommand');

  /**
   * Projections demo
   *
   * @purpose  Example
   */
  class PersonStatistics extends netxp_forgeexamplesAbstractExampleCommand {

    /**
     * Set criteria
     *
     * @param   string criteria default 'bz_id'
     */
    #[@arg(position= 0)]
    public function setField($field= 'bz_id') {
      $this->criteria= create(new Criteria())
        ->setProjection(Projections::projectionList(array(
          Projections::property(Person::column($field)), Projections::count())
        ))
        ->addGroupBy($field)
      ;
    }


    /**
     * Runs this command
     *
     */
    public function run() {
      for ($i= Person::getPeer()->iteratorFor($this->criteria); $i->hasNext(); ) {<commit_msg>- QA: WS/apidoc<commit_after><?php
/* This class is part of the XP framework
 *
 * $Id$
 */

  uses('net.xp_forge.examples.AbstractExampleCommand');

  /**
   * Projections demo
   *
   * @purpose  Example
   */
  class PersonStatistics extends netxp_forgeexamplesAbstractExampleCommand {

    /**
     * Set field to aggregate by
     *
     * @param   string field default 'bz_id'
     */
    #[@arg(position= 0)]
    public function setField($field= 'bz_id') {
      $this->criteria= create(new Criteria())
        ->setProjection(Projections::projectionList(array(
          Projections::property(Person::column($field)), Projections::count())
        ))
        ->addGroupBy($field)
      ;
    }

    /**
     * Runs this command
     *
     */
    public function run() {
      for ($i= Person::getPeer()->iteratorFor($this->criteria); $i->hasNext(); ) {
{'fraction_non_alphanumeric': 0.15137346580946814, 'fraction_numerical': 0.0011689070718877848, 'mean_word_length': 2.650319829424307, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '378358', 'n_tokens_mistral': 538, 'n_tokens_neox': 509, 'n_words': 103}