From 0c60ecc38a6fa9c8b2ecd3875fcaba53998d210c Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 4 Oct 2025 10:19:30 +0200 Subject: [PATCH 1/2] Mf2::parse_recursive: Document current args MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 7895e562a371ead5b1cb6eacb16a17dc23818633 replaced the `$htmlSafe` argument with `$convertClassic` but did not update PHPDoc. Let’s copy the description from `parse`. Pointed out by PHPStan level 1. --- Mf2/Parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mf2/Parser.php b/Mf2/Parser.php index c7cc02d..d20fb91 100644 --- a/Mf2/Parser.php +++ b/Mf2/Parser.php @@ -1499,7 +1499,7 @@ public function parse_recursive(DOMElement $context = null, $depth = 0) { * will be returned. * * @param string $id - * @param bool $htmlSafe = false whether or not to HTML-encode angle brackets in non e-* properties + * @param bool $convertClassic whether or not to convert classic microformats * @return array */ public function parseFromId($id, $convertClassic=true) { From 3921eadd6cd982cd59c5d2195f012c4133a013b3 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 4 Oct 2025 10:23:06 +0200 Subject: [PATCH 2/2] Mf2::parse: Fix PHPdoc param type `&` to denote reference is not allowed as part of type, use `@param-out`. https://phpstan.org/blog/enhancements-in-handling-parameters-passed-by-reference Pointed out by PHPStan level 1. --- Mf2/Parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mf2/Parser.php b/Mf2/Parser.php index d20fb91..3550107 100644 --- a/Mf2/Parser.php +++ b/Mf2/Parser.php @@ -59,7 +59,7 @@ function parse($input, $url = null, $convertClassic = true) { * * @param string $url The URL to fetch * @param bool $convertClassic (optional, default true) whether or not to convert classic microformats - * @param &array $curlInfo (optional) the results of curl_getinfo will be placed in this variable for debugging + * @param-out array $curlInfo (optional) the results of curl_getinfo will be placed in this variable for debugging * @return array|null canonical microformats2 array structure on success, null on failure */ function fetch($url, $convertClassic = true, &$curlInfo=null) {