original_string: public function addDirectory($directory)
      {
          $directories = $this->getDirectory(true);
  
          if (is_string($directory)) {
              $directory = explode(',', $directory);
          } else if (!is_array($directory)) {
              require_once 'Zend/Validate/Exception.php';
              throw new Zend_Validate_Exception ('Invalid options to validator provided');
          }
  
          foreach ($directory as $content) {
              if (empty($content) || !is_string($content)) {
                  continue;
              }
  
              $directories[] = trim($content);
          }
          $directories = array_unique($directories);
  
          // Sanity check to ensure no empty values
          foreach ($directories as $key => $dir) {
              if (empty($dir)) {
                  unset($directories[$key]);
              }
          }
  
          $this->_directory = implode(',', $directories);
  
          return $this;
      }
code: public function addDirectory($directory)
      {
          $directories = $this->getDirectory(true);
  
          if (is_string($directory)) {
              $directory = explode(',', $directory);
          } else if (!is_array($directory)) {
              require_once 'Zend/Validate/Exception.php';
              throw new Zend_Validate_Exception ('Invalid options to validator provided');
          }
  
          foreach ($directory as $content) {
              if (empty($content) || !is_string($content)) {
                  continue;
              }
  
              $directories[] = trim($content);
          }
          $directories = array_unique($directories);
  
          // Sanity check to ensure no empty values
          foreach ($directories as $key => $dir) {
              if (empty($dir)) {
                  unset($directories[$key]);
              }
          }
  
          $this->_directory = implode(',', $directories);
  
          return $this;
      }
code_tokens: public function addDirectory ( $ directory ) { $ directories = $ this -> getDirectory ( true ) ; if ( is_string ( $ directory ) ) { $ directory = explode ( ',' , $ directory ) ; } else if ( ! is_array ( $ directory ) ) { require_once 'Zend/Validate/Exception.php' ; throw new Zend_Validate_Exception ( 'Invalid options to validator provided' ) ; } foreach ( $ directory as $ content ) { if ( empty ( $ content ) || ! is_string ( $ content ) ) { continue ; } $ directories [ ] = trim ( $ content ) ; } $ directories = array_unique ( $ directories ) ; // Sanity check to ensure no empty values foreach ( $ directories as $ key => $ dir ) { if ( empty ( $ dir ) ) { unset ( $ directories [ $ key ] ) ; } } $ this -> _directory = implode ( ',' , $ directories ) ; return $ this ; }
docstring: Adds the file directory which will be checked
  
  @param  string|array $directory The directory to add for validation
  @return Zend_Validate_File_Extension Provides a fluent interface
docstring_tokens: Adds the file directory which will be checked