original_string: public function addExtension($extension)
      {
          $extensions = $this->getExtension();
          if (is_string($extension)) {
              $extension = explode(',', $extension);
          }
  
          foreach ($extension as $content) {
              if (empty($content) || !is_string($content)) {
                  continue;
              }
  
              $extensions[] = trim($content);
          }
          $extensions = array_unique($extensions);
  
          // Sanity check to ensure no empty values
          foreach ($extensions as $key => $ext) {
              if (empty($ext)) {
                  unset($extensions[$key]);
              }
          }
  
          $this->_extension = implode(',', $extensions);
  
          return $this;
      }
code: public function addExtension($extension)
      {
          $extensions = $this->getExtension();
          if (is_string($extension)) {
              $extension = explode(',', $extension);
          }
  
          foreach ($extension as $content) {
              if (empty($content) || !is_string($content)) {
                  continue;
              }
  
              $extensions[] = trim($content);
          }
          $extensions = array_unique($extensions);
  
          // Sanity check to ensure no empty values
          foreach ($extensions as $key => $ext) {
              if (empty($ext)) {
                  unset($extensions[$key]);
              }
          }
  
          $this->_extension = implode(',', $extensions);
  
          return $this;
      }
code_tokens: public function addExtension ( $ extension ) { $ extensions = $ this -> getExtension ( ) ; if ( is_string ( $ extension ) ) { $ extension = explode ( ',' , $ extension ) ; } foreach ( $ extension as $ content ) { if ( empty ( $ content ) || ! is_string ( $ content ) ) { continue ; } $ extensions [ ] = trim ( $ content ) ; } $ extensions = array_unique ( $ extensions ) ; // Sanity check to ensure no empty values foreach ( $ extensions as $ key => $ ext ) { if ( empty ( $ ext ) ) { unset ( $ extensions [ $ key ] ) ; } } $ this -> _extension = implode ( ',' , $ extensions ) ; return $ this ; }
docstring: Adds the file extensions
  
  @param  string|array $extension The extensions to add for validation
  @return Zend_Validate_File_Extension Provides a fluent interface
docstring_tokens: Adds the file extensions