-
-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathStaticReflectionService.php
More file actions
67 lines (53 loc) · 1.38 KB
/
StaticReflectionService.php
File metadata and controls
67 lines (53 loc) · 1.38 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
65
66
67
<?php
declare(strict_types=1);
namespace Doctrine\Persistence\Mapping;
use ReflectionClass;
use ReflectionProperty;
use function str_contains;
use function strpos;
use function strrev;
use function strrpos;
use function substr;
/**
* PHP Runtime Reflection Service.
*
* @deprecated No replacement planned
*/
class StaticReflectionService implements ReflectionService
{
/**
* {@inheritDoc}
*/
public function getParentClasses(string $class): array
{
return [];
}
public function getClassShortName(string $class): string
{
$nsSeparatorLastPosition = strrpos($class, '\\');
if ($nsSeparatorLastPosition !== false) {
$class = substr($class, $nsSeparatorLastPosition + 1);
}
return $class;
}
public function getClassNamespace(string $class): string
{
$namespace = '';
if (str_contains($class, '\\')) {
$namespace = strrev(substr(strrev($class), (int) strpos(strrev($class), '\\') + 1));
}
return $namespace;
}
public function getClass(string $class): ReflectionClass|null
{
return null;
}
public function getAccessibleProperty(string $class, string $property): ReflectionProperty|null
{
return null;
}
public function hasPublicMethod(string $class, string $method): bool
{
return true;
}
}