pietercolpaert / hardf

Low level PHP library for RDF1.1 based on N3.js
https://packagist.org/packages/pietercolpaert/hardf
MIT License
36 stars 7 forks source link

Travis: added PHP 7.4 #28

Closed k00ni closed 4 years ago

k00ni commented 4 years ago

@pietercolpaert any idea why this fails in PHP 7.4?

pietercolpaert commented 4 years ago

No idea in fact: it’s been a while since I’ve touched PHP7.4. I’ll add the help needed label to this one.

k00ni commented 4 years ago

I've found the problem of the failing test. In the writeLine closure (https://github.com/pietercolpaert/hardf/pull/28/files#diff-9c92b3d694a210ad957dbb820aa88a98L78-R82) the following line breaks in PHP 7.4:

$this->graph = $graph[0] !== '[' ? $graph : ']';

because $graph can be null. In the code is no check if $graph is an array or not. I found it after I enabled exceptions to get passed to caller, if arise. Before that, all exceptions were swallowed, including the PHP error complaining about null.

k00ni commented 4 years ago

Outdated, because #29 also included these changes.