Conversation
|
So none of the nightly php builds on travis are php 8.1 ... ho hum. So let's not pretend... here's the output from running the tests locally on PHP 8.1 |
(cherry picked from commit d9f55cb1b9822ada5231bf19fdf0f15a8c848615)
d336b02 to
b9baef8
Compare
| * @throws \OutOfBoundsException | ||
| * @throws \InvalidArgumentException | ||
| */ | ||
| #[\ReturnTypeWillChange] |
There was a problem hiding this comment.
This annotation allows us to suppress a deprecation notice triggered by PHP 8.1 - it will require fixing once PHP 9 is released. Since PHP 7.1 is the minimum version we could choose to add the return types here. I went the annotation route because changing or adding a return type should have a new major as per semver.
|
|
||
| // Then try and guess by the first 1024 bytes of content | ||
| $short = substr($data, 0, 1024); | ||
| $short = substr($data ?? '', 0, 1024); |
There was a problem hiding this comment.
One of the main PHP 8.1 is that built-in function that use to accept NULLs in string arguments will now trigger a deprecation.
|
|
||
| $html .= " ".htmlspecialchars($key)."=\"". | ||
| htmlspecialchars($value)."\""; | ||
| $html .= " ".htmlspecialchars($key, ENT_COMPAT)."=\"". |
There was a problem hiding this comment.
See https://php.watch/versions/8.1/html-entity-default-value-changes - adding ENT_COMPAT preserves the current behaviour.
| $doc = $graph->get('foaf:PersonalProfileDocument', '^rdf:type'); | ||
| $this->assertClass('EasyRdf\Resource', $doc); | ||
| $this->assertRegExp('|^file://.+/fixtures/foaf\.rdf$|', $doc->getUri()); | ||
| $this->assertMatchesRegularExpression('|^file://.+/fixtures/foaf\.rdf$|', $doc->getUri()); |
There was a problem hiding this comment.
The assertRegExp is deprecated in PHPUnit - the polyfill allows us to use the current method when running tests on the older versions of PHPUnit.
|
@njh PHP 8.1 has now hit RC2. It'd be great to land this and get a new release out so that projects that have EasyRDF as a dependency can have a stable release when PHP 8.1 lands. |
|
@njh PHP 8.1 has hit rc3 :) |
|
I don't know if I should open a new PR, but I found another php 8.1 deprecation warning, fixed similar to this PR, this is the change: |
|
@bircher I'll add it to this PR given a minute. |
|
@njh, any chance to see this committed? |
|
Hi everyone Any changed? it's ready? PHP will update to 8.2 tomorrow... and esayRDF will not work with this version... Thanks! |
|
@renderpci we have three (sic!) pull requests for making EasyRdf compatible with the PHP 8.1 just the last @njh's activity was 16 months ago and he's the only person with pull request merging rights. I'm afraid this constitutes an abandoned project.
|
Built on top of #383rebased on top of main now contains only PHP 8.1 changes.