original_string: public function checkFooter(TcTable $table, $row, $rowIndex) {
          $pdf = $table->getPdf();
          if ($rowIndex == $this->count - 1 && $pdf->GetY() + $this->height >= $this->pageBreakTrigger) {
              if ($table->trigger(TcTable::EV_PAGE_ADD, [$this->rows, $rowIndex, true]) !== false) {
                  $pdf->AddPage();
                  $table->trigger(TcTable::EV_PAGE_ADDED, [$this->rows, $rowIndex, true]);
              }
          }
      }
code: public function checkFooter(TcTable $table, $row, $rowIndex) {
          $pdf = $table->getPdf();
          if ($rowIndex == $this->count - 1 && $pdf->GetY() + $this->height >= $this->pageBreakTrigger) {
              if ($table->trigger(TcTable::EV_PAGE_ADD, [$this->rows, $rowIndex, true]) !== false) {
                  $pdf->AddPage();
                  $table->trigger(TcTable::EV_PAGE_ADDED, [$this->rows, $rowIndex, true]);
              }
          }
      }
code_tokens: public function checkFooter ( TcTable $ table , $ row , $ rowIndex ) { $ pdf = $ table -> getPdf ( ) ; if ( $ rowIndex == $ this -> count - 1 && $ pdf -> GetY ( ) + $ this -> height >= $ this -> pageBreakTrigger ) { if ( $ table -> trigger ( TcTable :: EV_PAGE_ADD , [ $ this -> rows , $ rowIndex , true ] ) !== false ) { $ pdf -> AddPage ( ) ; $ table -> trigger ( TcTable :: EV_PAGE_ADDED , [ $ this -> rows , $ rowIndex , true ] ) ; } } }
docstring: Check if there's space for the footer, after the last row is added
  
  @param TcTable $table
  @param array|object $row
  @param int $rowIndex
  @return void
docstring_tokens: Check if there s space for the footer after the last row is added