Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Failed Conditions
Pull Request — master (#1073)
by Dan
05:01
created

test/SmrTest/TestUtils.php (1 issue)

Labels
Severity
1
<?php declare(strict_types=1);
2
3
namespace SmrTest;
4
5
class TestUtils {
6
7
	/**
8
	 * Get a private or protected method for testing/documentation purposes.
9
	 * Note that this function should only be used as a last resort! Its use
10
	 * indicates that the input class is a good candidate for refactoring.
11
	 *
12
	 * How to use for MyClass->foo():
13
	 *    $cls = new MyClass();
14
	 *    $foo = SmrTest\TestUtils::getPrivateMethod($cls, 'foo');
15
	 *    $foo->invoke($cls, $args, ...);
16
	 *
17
	 * @param object $obj The instance of your class
18
	 * @param string $name The name of your private/protected method
19
	 * @return ReflectionMethod The method you want to test
0 ignored issues
show
The type SmrTest\ReflectionMethod was not found. Did you mean ReflectionMethod? If so, make sure to prefix the type with \.
Loading history...
20
	 */
21
	public static function getPrivateMethod(object $obj, string $name) : \ReflectionMethod {
22
		$class = new \ReflectionClass($obj);
23
		$method = $class->getMethod($name);
24
		$method->setAccessible(true);
25
		return $method;
26
	}
27
28
}
29