original_string: public function getValidFiles($index = null)
  	{
  		// prepare the selection
  		if (is_numeric($index))
  		{
  			$selection = $this->container;
  		}
  		else
  		{
  			$selection = (func_num_args() and ! is_null($index)) ? $this[$index] : $this->container;
  		}
  
  		// storage for the results
  		$results = array();
  
  		if ($selection)
  		{
  			// make sure selection is an array
  			is_array($selection) or $selection = array($selection);
  
  			// loop through all files
  			foreach ($selection as $file)
  			{
  				// store only files that are valid
  				$file->isValid() and $results[] = $file;
  			}
  		}
  
  		// return the results
  		if (is_numeric($index))
  		{
  			// a specific valid file was requested
  			return isset($results[$index]) ? array($results[$index]) : array();
  		}
  		else
  		{
  			return $results;
  		}
  	}
code: public function getValidFiles($index = null)
  	{
  		// prepare the selection
  		if (is_numeric($index))
  		{
  			$selection = $this->container;
  		}
  		else
  		{
  			$selection = (func_num_args() and ! is_null($index)) ? $this[$index] : $this->container;
  		}
  
  		// storage for the results
  		$results = array();
  
  		if ($selection)
  		{
  			// make sure selection is an array
  			is_array($selection) or $selection = array($selection);
  
  			// loop through all files
  			foreach ($selection as $file)
  			{
  				// store only files that are valid
  				$file->isValid() and $results[] = $file;
  			}
  		}
  
  		// return the results
  		if (is_numeric($index))
  		{
  			// a specific valid file was requested
  			return isset($results[$index]) ? array($results[$index]) : array();
  		}
  		else
  		{
  			return $results;
  		}
  	}
code_tokens: public function getValidFiles ( $ index = null ) { // prepare the selection if ( is_numeric ( $ index ) ) { $ selection = $ this -> container ; } else { $ selection = ( func_num_args ( ) and ! is_null ( $ index ) ) ? $ this [ $ index ] : $ this -> container ; } // storage for the results $ results = array ( ) ; if ( $ selection ) { // make sure selection is an array is_array ( $ selection ) or $ selection = array ( $ selection ) ; // loop through all files foreach ( $ selection as $ file ) { // store only files that are valid $ file -> isValid ( ) and $ results [ ] = $ file ; } } // return the results if ( is_numeric ( $ index ) ) { // a specific valid file was requested return isset ( $ results [ $ index ] ) ? array ( $ results [ $ index ] ) : array ( ) ; } else { return $ results ; } }
docstring: Returns the list of uploaded files that valid
  
  @param integer|string $index
  
  @return File[]
docstring_tokens: Returns the list of uploaded files that valid