• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nette / utils / 21636962765

03 Feb 2026 03:39PM UTC coverage: 93.312% (+0.05%) from 93.264%
21636962765

push

github

dg
added CLAUDE.md

2065 of 2213 relevant lines covered (93.31%)

0.93 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
/src/Utils/ReflectionMethod.php
1
<?php
2

3
/**
4
 * This file is part of the Nette Framework (https://nette.org)
5
 * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6
 */
7

8
declare(strict_types=1);
9

10
namespace Nette\Utils;
11

12
use function explode, is_string, str_contains;
13

14

15
/**
16
 * ReflectionMethod preserving the original class name.
17
 * @internal
18
 */
19
final class ReflectionMethod extends \ReflectionMethod
20
{
21
        /** @var \ReflectionClass<object> */
22
        private readonly \ReflectionClass $originalClass;
23

24

25
        public function __construct(object|string $objectOrMethod, ?string $method = null)
1✔
26
        {
27
                if (is_string($objectOrMethod) && str_contains($objectOrMethod, '::')) {
1✔
28
                        [$objectOrMethod, $method] = explode('::', $objectOrMethod, 2);
×
29
                }
30
                parent::__construct($objectOrMethod, $method);
1✔
31
                $this->originalClass = new \ReflectionClass($objectOrMethod);
1✔
32
        }
1✔
33

34

35
        /** @return \ReflectionClass<object> */
36
        public function getOriginalClass(): \ReflectionClass
37
        {
38
                return $this->originalClass;
1✔
39
        }
40
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc