original_string: protected function duplicate($args) {
  		$targets = is_array($args['targets']) ? $args['targets'] : array();
  		$result  = array('added' => array());
  		$suffix  = empty($args['suffix']) ? 'copy' : $args['suffix'];
  		
  		foreach ($targets as $target) {
  			if (($volume = $this->volume($target)) == false
  			|| ($src = $volume->file($target)) == false) {
  				$result['warning'] = $this->error(self::ERROR_COPY, '#'.$target, self::ERROR_FILE_NOT_FOUND);
  				break;
  			}
  			
  			if (($file = $volume->duplicate($target, $suffix)) == false) {
  				$result['warning'] = $this->error($volume->error());
  				break;
  			}
  			
  			$result['added'][] = $file;
  		}
  		
  		return $result;
  	}
code: protected function duplicate($args) {
  		$targets = is_array($args['targets']) ? $args['targets'] : array();
  		$result  = array('added' => array());
  		$suffix  = empty($args['suffix']) ? 'copy' : $args['suffix'];
  		
  		foreach ($targets as $target) {
  			if (($volume = $this->volume($target)) == false
  			|| ($src = $volume->file($target)) == false) {
  				$result['warning'] = $this->error(self::ERROR_COPY, '#'.$target, self::ERROR_FILE_NOT_FOUND);
  				break;
  			}
  			
  			if (($file = $volume->duplicate($target, $suffix)) == false) {
  				$result['warning'] = $this->error($volume->error());
  				break;
  			}
  			
  			$result['added'][] = $file;
  		}
  		
  		return $result;
  	}
code_tokens: protected function duplicate ( $ args ) { $ targets = is_array ( $ args [ 'targets' ] ) ? $ args [ 'targets' ] : array ( ) ; $ result = array ( 'added' => array ( ) ) ; $ suffix = empty ( $ args [ 'suffix' ] ) ? 'copy' : $ args [ 'suffix' ] ; foreach ( $ targets as $ target ) { if ( ( $ volume = $ this -> volume ( $ target ) ) == false || ( $ src = $ volume -> file ( $ target ) ) == false ) { $ result [ 'warning' ] = $ this -> error ( self :: ERROR_COPY , '#' . $ target , self :: ERROR_FILE_NOT_FOUND ) ; break ; } if ( ( $ file = $ volume -> duplicate ( $ target , $ suffix ) ) == false ) { $ result [ 'warning' ] = $ this -> error ( $ volume -> error ( ) ) ; break ; } $ result [ 'added' ] [ ] = $ file ; } return $ result ; }
docstring: Duplicate file - create copy with "copy %d" suffix
  
  @param array  $args  command arguments
  @return array
  @author Dmitry (dio) Levashov
docstring_tokens: Duplicate file - create copy with copy %d suffix