original_string: public function getLast($strType = "")
      {
          $varReturn = null;
  
          if (count($this->collection) > 0) {
              if (! empty($strType)) {
                  $arrTemp = array_reverse($this->collection);
                  foreach ($arrTemp as $object) {
                      if (get_class($object) == $strType) {
                          $varReturn = $object;
                          break;
                      }
                  }
              } else {
                  $varReturn = $this->collection[$this->count() - 1];
              }
          }
  
          return $varReturn;
      }
code: public function getLast($strType = "")
      {
          $varReturn = null;
  
          if (count($this->collection) > 0) {
              if (! empty($strType)) {
                  $arrTemp = array_reverse($this->collection);
                  foreach ($arrTemp as $object) {
                      if (get_class($object) == $strType) {
                          $varReturn = $object;
                          break;
                      }
                  }
              } else {
                  $varReturn = $this->collection[$this->count() - 1];
              }
          }
  
          return $varReturn;
      }
code_tokens: public function getLast ( $ strType = "" ) { $ varReturn = null ; if ( count ( $ this -> collection ) > 0 ) { if ( ! empty ( $ strType ) ) { $ arrTemp = array_reverse ( $ this -> collection ) ; foreach ( $ arrTemp as $ object ) { if ( get_class ( $ object ) == $ strType ) { $ varReturn = $ object ; break ; } } } else { $ varReturn = $ this -> collection [ $ this -> count ( ) - 1 ] ; } } return $ varReturn ; }
docstring: Get last element in collection
  
  @param string $strType Optional type to search for. For example, you can search the Collection for the
  last Hidden element by doing: `$objCollection->getLast("\\ValidFormBuilder\\Hidden")`.
  @return mixed Returns last element in collection, null if collection is empty
docstring_tokens: Get last element in collection