This PR fixes all failing tests on PHP 8.0, 8.1 and 8.2. Note that your CI is currently testing on PHP 7.4 only, which is why those issues remained undiscovered by it. I would recommend to test on multiple PHP versions, at least on the lowest and highest supported one.
Issues addressed:
PHP 8.1 introduced tentative return types for core interfaces. We either need to add return types or use an attribute to indicate our intention to add the types in a future release. Adding return types to non-final classes is a BC break and the types that we would need to add are not compatible with PHP 7.4. Therefore I chose the attribute.
Several core functions trigger throw TypeErrors and ValueErrors instead of triggering an error that can be silenced. I have made the necessary adjustments.
Replaces #45
This PR fixes all failing tests on PHP 8.0, 8.1 and 8.2. Note that your CI is currently testing on PHP 7.4 only, which is why those issues remained undiscovered by it. I would recommend to test on multiple PHP versions, at least on the lowest and highest supported one.
Issues addressed:
PHP 8.1 introduced tentative return types for core interfaces. We either need to add return types or use an attribute to indicate our intention to add the types in a future release. Adding return types to non-final classes is a BC break and the types that we would need to add are not compatible with PHP 7.4. Therefore I chose the attribute.
Several core functions trigger throw
TypeError
s andValueError
s instead of triggering an error that can be silenced. I have made the necessary adjustments.