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

  uses('util.cmd.Console');

  /**
   * Dumps an API
   *
   * @purpose  purpose
   */
  class Api extends Object {
    protected
      $class          = '',
      $showDeclaring  = FALSE;

    /**
     * Set classname
     *
     * @param   string classname
     */
    #[@arg(position= 0)]
    public function setClassname($classname) {
      $this->class= &XPClass::forName($classname);
    }

    /**
     * Set whether declaring classes should be shown
     *
     * @param   bool show default FALSE
     */
    #[@arg(short= 'd')]
    public function setShowDeclaring($show= FALSE) {
      $this->showDeclaring= (bool)$show;
    }

    /**
     * Run this command
     *
     */
    public function run() {
      Console::write($this->class->toString());
      Console::writeLine(' extends ', $this->class->getParentClass()->toString(), ' {');
      foreach ($this->class->getFields() as $field) {
        Console::writeLine('  ', $field->toString());
      }
      if ($this->class->hasConstructor()) {
        Console::writeLine('  ', $this->class->getConstructor()->toString());
      }
      foreach($this->class->getMethods() as $method) {
        Console::write('  ', $method->toString());
        $this->showDeclaring && Console::write(' declared in '.$method->getDeclaringClass()->toString());
        Console::writeLine();
      }
      Console::writeLine('}');
    }
  }
?>
<commit_msg>- Migrate to PHP5 - leftover references removal<commit_after><?php
/* This class is part of the XP framework's experiments
 *
 * $Id$ 
 */

  uses('util.cmd.Console');

  /**
   * Dumps an API
   *
   * @purpose  purpose
   */
  class Api extends Object {
    protected
      $class          = '',
      $showDeclaring  = FALSE;

    /**
     * Set classname
     *
     * @param   string classname
     */
    #[@arg(position= 0)]
    public function setClassname($classname) {
      $this->class= XPClass::forName($classname);
    }

    /**
     * Set whether declaring classes should be shown
     *
     * @param   bool show default FALSE
     */
    #[@arg(short= 'd')]
    public function setShowDeclaring($show= FALSE) {
      $this->showDeclaring= (bool)$show;
    }

    /**
     * Run this command
     *
     */
    public function run() {
      Console::write($this->class->toString());
      Console::writeLine(' extends ', $this->class->getParentClass()->toString(), ' {');
      foreach ($this->class->getFields() as $field) {
        Console::writeLine('  ', $field->toString());
      }
      if ($this->class->hasConstructor()) {
        Console::writeLine('  ', $this->class->getConstructor()->toString());
      }
      foreach($this->class->getMethods() as $method) {
        Console::write('  ', $method->toString());
        $this->showDeclaring && Console::write(' declared in '.$method->getDeclaringClass()->toString());
        Console::writeLine();
      }
      Console::writeLine('}');
    }
  }
?>

{'fraction_non_alphanumeric': 0.1768595041322314, 'fraction_numerical': 0.0009917355371900827, 'mean_word_length': 2.4076576576576576, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 47, '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': '2639693', 'n_tokens_mistral': 907, 'n_tokens_neox': 882, 'n_words': 184}