forked from doctrine/persistence
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReflectionService.php
More file actions
64 lines (55 loc) · 1.56 KB
/
ReflectionService.php
File metadata and controls
64 lines (55 loc) · 1.56 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
declare(strict_types=1);
namespace Doctrine\Persistence\Mapping;
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.
*
* @psalm-param class-string $class
*
* @return string[]
* @psalm-return class-string[]
*
* @throws MappingException
*/
public function getParentClasses(string $class): array;
/**
* Returns the shortname of a class.
*
* @psalm-param class-string $class
*/
public function getClassShortName(string $class): string;
/** @psalm-param class-string $class */
public function getClassNamespace(string $class): string;
/**
* Returns a reflection class instance or null.
*
* @psalm-param class-string<T> $class
*
* @psalm-return ReflectionClass<T>
*
* @template T of object
*/
public function getClass(string $class): ReflectionClass;
/**
* Returns an accessible property (setAccessible(true)) or null.
*
* @psalm-param class-string $class
*/
public function getAccessibleProperty(string $class, string $property): ReflectionProperty|null;
/**
* Checks if the class have a public method with the given name.
*
* @psalm-param class-string $class
*/
public function hasPublicMethod(string $class, string $method): bool;
}