diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b623970..e067caa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/Mf2/Parser.php b/Mf2/Parser.php index c7cc02d..5670b61 100644 --- a/Mf2/Parser.php +++ b/Mf2/Parser.php @@ -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); @@ -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); @@ -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)))' diff --git a/composer.json b/composer.json index bdd43d7..d08080b 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "bin": ["bin/fetch-mf2", "bin/parse-mf2"], "require": { - "php": ">=5.6.0" + "php": ">=7.1.0" }, "config": { "platform": { diff --git a/phpcs.xml b/phpcs.xml index 8e94cdd..7597fef 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -3,5 +3,5 @@ PHP-MF2 Standards ./Mf2/Parser.php - +