0

Fatal error: Declaration of Cached_PDF_Decorator::_construct() must be compatible with that of Canvas::_construct() in /my/path/to/cached_pdf_decorator.cls.php on line 22

relevant code in Cached_PDF_Decorator:

class Cached_PDF_Decorator extends CPDF_Adapter implements Canvas {
...
function __construct($cache_id, CPDF_Adapter $pdf) {
  $this->_pdf = $pdf;
  $this->_cache_id = $cache_id;
  $this->_fonts = array();

  $this->_current_page_id = $this->_pdf->open_object();
}

relevant code in interface Canvas:

interface Canvas {
function __construct($paper = "letter", $orientation = "portrait", DOMPDF $dompdf);

Shouldn't the parameters in Cached_PDF_Decorator's __construct match up with those in Canvas? Thanks!

DefZep
  • 153
  • 2
  • 11
  • Why yes, they should. They have to, according to the interface. This is surely a bug that you should report upstream. – Charles Dec 27 '12 at 05:06
  • And, indeed, the [code has been updated](https://github.com/dompdf/dompdf/commit/dfb7104a12dc703c10b25d9146bd19b6f6f49a5b). If you have not yet done so, update your copy of dompdf to resolve the issue. – BrianS Jan 11 '13 at 03:53

0 Answers0