caxy / php-htmldiff

A library for comparing two HTML files/snippets and highlighting the differences using simple HTML. Includes support for comparing complex lists and tables
http://php-htmldiff.caxy.com
GNU General Public License v2.0
202 stars 51 forks source link

Check object is actual array before calling count to prevent warnings #91

Closed daum closed 3 years ago

daum commented 4 years ago

As of PHP 7.2 if you pass count(null) it'll emit a warning of Parameter must be an array or an object that implements Countable in … This makes sure that the $words is actually an array and not null, so it is in fact countable.

daum commented 4 years ago

Let me know if you need anything else on it.

daum commented 4 years ago

@jschroed91 Did you need anything else done on this PR?

daum commented 4 years ago

@jschroed91 Do you have an update for when you think this may be merged?

SavageTiger commented 3 years ago

Hi 👋

Its been a while, but I have looked into this PR.

However I am a bit confused about it, since the preposed changes are both in the intertTag method, and the method gets called from processInsertOperation or processDeleteOperation and both those methods initiate a array that can never be null. So for now I am closing this PR.

If I am mistaken, feel free to let me know.