/
ReflectionService.php
49 lines (40 loc) · 1.29 KB
/
ReflectionService.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
declare(strict_types=1);
namespace Doctrine\ORM\Reflection;
use InvalidArgumentException;
use ReflectionClass;
use ReflectionProperty;
/**
* Very simple reflection service abstraction.
*
* This is required inside metadata layers that may require either
* static or runtime reflection.
*/
interface ReflectionService
{
/**
* Returns an array of the parent classes (not interfaces) for the given class.
*
* @return string[]
*
* @throws InvalidArgumentException If provided argument is not a valid class name.
*/
public function getParentClasses(string $className) : array;
/**
* Returns the shortname of a class.
*/
public function getClassShortName(string $className) : string;
public function getClassNamespace(string $className) : string;
/**
* Returns a reflection class instance or null.
*/
public function getClass(string $className) : ?ReflectionClass;
/**
* Returns an accessible property (setAccessible(true)) or null.
*/
public function getAccessibleProperty(string $className, string $propertyName) : ?ReflectionProperty;
/**
* Checks if the class have a public method with the given name.
*/
public function hasPublicMethod(string $className, string $methodName) : bool;
}