File tree Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /*
4+ * This file is part of the Symfony MakerBundle package.
5+ *
6+ * (c) Fabien Potencier <[email protected] > 7+ *
8+ * For the full copyright and license information, please view the LICENSE
9+ * file that was distributed with this source code.
10+ */
11+
12+ namespace Symfony \Bundle \MakerBundle \Doctrine ;
13+
14+ use Doctrine \Persistence \Mapping \ReflectionService ;
15+
16+ /**
17+ * @internal replacing removed Doctrine\Persistence\Mapping\StaticReflectionService
18+ */
19+ final class StaticReflectionService implements ReflectionService
20+ {
21+ public function getParentClasses (string $ class ): array
22+ {
23+ return [];
24+ }
25+
26+ public function getClassShortName (string $ class ): string
27+ {
28+ $ nsSeparatorLastPosition = strrpos ($ class , '\\' );
29+
30+ if ($ nsSeparatorLastPosition !== false ) {
31+ $ class = substr ($ class , $ nsSeparatorLastPosition + 1 );
32+ }
33+
34+ return $ class ;
35+ }
36+
37+ public function getClassNamespace (string $ class ): string
38+ {
39+ $ namespace = '' ;
40+
41+ if (strpos ($ class , '\\' ) !== false ) {
42+ $ namespace = strrev (substr (strrev ($ class ), (int ) strpos (strrev ($ class ), '\\' ) + 1 ));
43+ }
44+
45+ return $ namespace ;
46+ }
47+
48+ public function getClass (string $ class ): \ReflectionClass
49+ {
50+ return new \ReflectionClass ($ class );
51+ }
52+
53+ public function getAccessibleProperty (string $ class , string $ property ): ?\ReflectionProperty
54+ {
55+ return null ;
56+ }
57+
58+ public function hasPublicMethod (string $ class , string $ method ): bool
59+ {
60+ return true ;
61+ }
62+ }
You can’t perform that action at this time.
0 commit comments