Skip to content

PHP 8 support#142

Merged
l0gicgate merged 1 commit into
slimphp:masterfrom
edudobay:php8
Nov 20, 2020
Merged

PHP 8 support#142
l0gicgate merged 1 commit into
slimphp:masterfrom
edudobay:php8

Conversation

@edudobay
Copy link
Copy Markdown
Contributor

@edudobay edudobay commented Nov 1, 2020

This PR allows Slim to be installed in PHP 8 and passes all the tests and checks.

See also slimphp/Slim#3015 and slimphp/Slim-Psr7#169 for corresponding changes.

The same questions apply here:

  • I implemented disableXmlEntityLoader as a private static method. Is this okay? I thought about making it protected or extracting it to a class, but I'm unsure about creating new "contracts".
  • Coverage – conditional call to libxml_disable_entity_loader. Is it okay to just @codeCoverageIgnore some part that will only run in PHP 7 or PHP 8? How should situations like this be handled?

Dependencies: all dependencies have PHP 8-compatible releases now!

@coveralls
Copy link
Copy Markdown

coveralls commented Nov 1, 2020

Coverage Status

Coverage remained the same at 100.0% when pulling 4715329 on edudobay:php8 into 55a46cc on slimphp:master.

@edudobay edudobay mentioned this pull request Nov 1, 2020
5 tasks
@l0gicgate
Copy link
Copy Markdown
Member

@edudobay thank you for this. Let's go with the same roadmap we agreed to on the main Slim repo. When all the official releases come out we can make the appropriate changes to support 8.0

1. Allow PHPUnit 9 (needed for PHP 8)

2. Shim deprecated libxml functions

Make the call to libxml_disable_entity_loader conditional.  This
function has been deprecated in PHP 8.0 and the new default is
equivalent to calling that function with `true`.

https://php.watch/versions/8.0/libxml_disable_entity_loader-deprecation

Note: there were two instances of exactly the same XML-parsing anonymous
function. I've traced this duplication back to 2015 when the functions
were one line long and explicitness might have been better than
deduplication. Over the years these functions have been growing together
and I see no obvious reason why two copies should be maintained.
@edudobay
Copy link
Copy Markdown
Contributor Author

All set for this one! All dependencies have been released with PHP 8.0 support.

@edudobay edudobay changed the title Draft: PHP 8 support PHP 8 support Nov 20, 2020
@l0gicgate
Copy link
Copy Markdown
Member

Fantastic, thank you for your contributions @edudobay!

@l0gicgate l0gicgate added this to the 1.2 milestone Nov 20, 2020
@l0gicgate l0gicgate merged commit 3bc9d61 into slimphp:master Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants