diff --git a/build/kint.phar b/build/kint.phar index 6e2352d65..c90864f50 100644 Binary files a/build/kint.phar and b/build/kint.phar differ diff --git a/src/Zval/MethodValue.php b/src/Zval/MethodValue.php index cea4e5ba6..44c096f4f 100644 --- a/src/Zval/MethodValue.php +++ b/src/Zval/MethodValue.php @@ -223,7 +223,7 @@ public function getPhpDocUrl(): ?string } if ($this->owner_class) { - $class = \strtolower($this->owner_class); + $class = \str_replace('\\', '-', \strtolower($this->owner_class)); } else { $class = 'function'; } diff --git a/tests/Zval/MethodValueTest.php b/tests/Zval/MethodValueTest.php index 5a14894f2..48ff37792 100644 --- a/tests/Zval/MethodValueTest.php +++ b/tests/Zval/MethodValueTest.php @@ -39,6 +39,7 @@ use Kint\Zval\MethodValue; use Kint\Zval\Value; use LogicException; +use Random\Randomizer; use ReflectionFunction; use ReflectionMethod; use stdClass; @@ -275,4 +276,20 @@ public function testGetPhpDocUrlFunction() $m->getPhpDocUrl() ); } + + /** + * @covers \Kint\Zval\MethodValue::getPhpDocUrl + */ + public function testGetPhpDocUrlNamespaced() + { + if (!KINT_PHP82) { + $this->markTestSkipped('Not testing namespaced PHP doc pages below PHP 8.2'); + } + + $m = new MethodValue(new ReflectionMethod(Randomizer::class, 'getBytes')); + $this->assertSame( + 'https://secure.php.net/random-randomizer.getbytes', + $m->getPhpDocUrl() + ); + } }