Skip to content

Fix PHP 8.4 compatibility / drop support for PHP < 7.1 #264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
php: ['5.6', '7.3', '7.4', '8.0', '8.1']
php: ['7.1', '7.3', '7.4', '8.0', '8.1']

runs-on: ubuntu-latest

Expand Down
6 changes: 3 additions & 3 deletions Mf2/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,7 @@ public function upgradeRelTagToCategory(DOMElement $el) {
* @param DOMElement $context optionally specify an element from which to parse microformats
* @return array An array containing all the microformats found in the current document
*/
public function parse($convertClassic = true, DOMElement $context = null) {
public function parse($convertClassic = true, ?DOMElement $context = null) {
$this->convertClassic = $convertClassic;
$mfs = $this->parse_recursive($context);

Expand Down Expand Up @@ -1411,7 +1411,7 @@ public function parse($convertClassic = true, DOMElement $context = null) {
* @param int $depth: recursion depth
* @return array
*/
public function parse_recursive(DOMElement $context = null, $depth = 0) {
public function parse_recursive(?DOMElement $context = null, $depth = 0) {
$mfs = array();
$mfElements = $this->getRootMF($context);

Expand Down Expand Up @@ -1516,7 +1516,7 @@ public function parseFromId($id, $convertClassic=true) {
* @param DOMElement $context
* @return DOMNodeList
*/
public function getRootMF(DOMElement $context = null) {
public function getRootMF(?DOMElement $context = null) {
// start with mf2 root class name xpath
$xpaths = array(
'(php:function("\\Mf2\\classHasMf2RootClassname", normalize-space(@class)))'
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"bin": ["bin/fetch-mf2", "bin/parse-mf2"],
"require": {
"php": ">=5.6.0"
"php": ">=7.1.0"
},
"config": {
"platform": {
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<description>PHP-MF2 Standards</description>
<file>./Mf2/Parser.php</file>
<rule ref="PHPCompatibility"/>
<config name="testVersion" value="5.6-"/>
<config name="testVersion" value="7.1-"/>
</ruleset>