diff options
Diffstat (limited to 'vendor/doctrine/persistence/src/Persistence/Mapping/StaticReflectionService.php')
-rw-r--r-- | vendor/doctrine/persistence/src/Persistence/Mapping/StaticReflectionService.php | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/vendor/doctrine/persistence/src/Persistence/Mapping/StaticReflectionService.php b/vendor/doctrine/persistence/src/Persistence/Mapping/StaticReflectionService.php new file mode 100644 index 0000000..c9f2147 --- /dev/null +++ b/vendor/doctrine/persistence/src/Persistence/Mapping/StaticReflectionService.php | |||
@@ -0,0 +1,78 @@ | |||
1 | <?php | ||
2 | |||
3 | declare(strict_types=1); | ||
4 | |||
5 | namespace Doctrine\Persistence\Mapping; | ||
6 | |||
7 | use function strpos; | ||
8 | use function strrev; | ||
9 | use function strrpos; | ||
10 | use function substr; | ||
11 | |||
12 | /** | ||
13 | * PHP Runtime Reflection Service. | ||
14 | */ | ||
15 | class StaticReflectionService implements ReflectionService | ||
16 | { | ||
17 | /** | ||
18 | * {@inheritDoc} | ||
19 | */ | ||
20 | public function getParentClasses(string $class) | ||
21 | { | ||
22 | return []; | ||
23 | } | ||
24 | |||
25 | /** | ||
26 | * {@inheritDoc} | ||
27 | */ | ||
28 | public function getClassShortName(string $class) | ||
29 | { | ||
30 | $nsSeparatorLastPosition = strrpos($class, '\\'); | ||
31 | |||
32 | if ($nsSeparatorLastPosition !== false) { | ||
33 | $class = substr($class, $nsSeparatorLastPosition + 1); | ||
34 | } | ||
35 | |||
36 | return $class; | ||
37 | } | ||
38 | |||
39 | /** | ||
40 | * {@inheritDoc} | ||
41 | */ | ||
42 | public function getClassNamespace(string $class) | ||
43 | { | ||
44 | $namespace = ''; | ||
45 | |||
46 | if (strpos($class, '\\') !== false) { | ||
47 | $namespace = strrev(substr(strrev($class), (int) strpos(strrev($class), '\\') + 1)); | ||
48 | } | ||
49 | |||
50 | return $namespace; | ||
51 | } | ||
52 | |||
53 | /** | ||
54 | * {@inheritDoc} | ||
55 | * | ||
56 | * @return null | ||
57 | */ | ||
58 | public function getClass(string $class) | ||
59 | { | ||
60 | return null; | ||
61 | } | ||
62 | |||
63 | /** | ||
64 | * {@inheritDoc} | ||
65 | */ | ||
66 | public function getAccessibleProperty(string $class, string $property) | ||
67 | { | ||
68 | return null; | ||
69 | } | ||
70 | |||
71 | /** | ||
72 | * {@inheritDoc} | ||
73 | */ | ||
74 | public function hasPublicMethod(string $class, string $method) | ||
75 | { | ||
76 | return true; | ||
77 | } | ||
78 | } | ||