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

  uses('io.collections.iterate.IterationFilter');

  /**
   * Extension filter
   *
   * @purpose  Iteration Filter
   */
  class ExtensionEqualsFilter extends Object implements IterationFilter {
    public
      $extension= '';
      
    /**
     * Constructor
     *
     * @param   string extension the file extension to compare to
     */
    public function __construct($extension) {
      $this->extension= '.'.ltrim($extension, '.');
    }
  
    /**
     * Accepts an element
     *
     * @param   io.collections.IOElement element
     * @return  bool
     */
    public function accept($element) {
      return $this->extension == substr($element->getURI(), -1 * strlen($this->extension));
    }

    /**
     * Creates a string representation of this iterator
     *
     * @return  string
     */
    public function toString() {
      return $this->getClassName().'("'.$this->compare.'")';
    }
  
  } 
?><commit_msg>- Fix toString() output<commit_after><?php
/* This class is part of the XP framework
 *
 * $Id$
 */

  uses('io.collections.iterate.IterationFilter');

  /**
   * Extension filter
   *
   * @purpose  Iteration Filter
   */
  class ExtensionEqualsFilter extends Object implements IterationFilter {
    public
      $extension= '';
      
    /**
     * Constructor
     *
     * @param   string extension the file extension to compare to
     */
    public function __construct($extension) {
      $this->extension= '.'.ltrim($extension, '.');
    }
  
    /**
     * Accepts an element
     *
     * @param   io.collections.IOElement element
     * @return  bool
     */
    public function accept($element) {
      return $this->extension == substr($element->getURI(), -1 * strlen($this->extension));
    }

    /**
     * Creates a string representation of this iterator
     *
     * @return  string
     */
    public function toString() {
      return $this->getClassName().'("'.$this->extension.'")';
    }
  
  } 
?>
{'fraction_non_alphanumeric': 0.140117994100295, 'fraction_numerical': 0.0009832841691248771, 'mean_word_length': 2.256, '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': '6439210', 'n_tokens_mistral': 587, 'n_tokens_neox': 582, 'n_words': 141}