tel8618217223380 / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

Remove Warnings/Errors in DOMPDF Code Validation #514

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
There are 89 code validation warnings/errors in the DOMPDF that stem from four 
main categories:

1) Assignment in condition

   Easy fixes, for example:
     CHANGE:   while ( $child = $this->_first_child )
     TO:       while ( ($child = $this->_first_child) !== false )

2) Bad escape sequence: \?

   Easy fixes, for example:
     CHANGE:   $ret = preg_replace("/\?(.*)$/", "", $ret);
     TO:       $ret = preg_replace('/\?(.*)$/', "", $ret);

3) Class not found
  ** See Attached Errors **

4) Class 'TCPDF_Adapter' must implement inherited abstract method 'scale(...)'
  ** See Attached Errors **

These can be fixed very quickly by simply performing basic validation across 
the project using an IDE such as Eclipse or Zend Studio. I would be extremely 
grateful if these were fixed in the main repository instead of having to fork 
and maintain a separate clone.

Original issue reported on code.google.com by virg...@gmail.com on 10 Jul 2012 at 2:58

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
agree with above

Original comment by r...@deardoc.com on 12 Jul 2012 at 8:19

GoogleCodeExporter commented 9 years ago
Hello, are you sure about the first change ? I think that ->_first_child is 
null when empty.
For the other issues, I'll take care of them.

Original comment by fabien.menager on 8 Aug 2012 at 1:09

GoogleCodeExporter commented 9 years ago
Great catch! I overlooked the actual contents of the condition in the example 
above which is referencing a node from a disposed parent. Some of the other 
condition assignments are different so this will need to be treated on a case 
by case basis:

For Example:
* page_cache.cls.php -- while ($row = pg_fetch_assoc($res)) -- Use: !== false
* inline_renderer.cls.php -- if ( $href = $link_node->getAttribute("href") ) -- 
Use : !== ''

Original comment by m...@deardoc.com on 8 Aug 2012 at 5:02

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 24 May 2013 at 3:00