File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 "php-java/java-net-package" : " *" ,
2323 "php-java/java-nio-package" : " *" ,
2424 "gabrielelana/byte-units" : " dev-master" ,
25- "symfony/console" : " 4.2"
25+ "symfony/console" : " 4.2" ,
26+ "phpdocumentor/reflection-docblock" : " 4.3"
2627 },
2728 "autoload" : {
2829 "psr-4" : {
Original file line number Diff line number Diff line change @@ -48,11 +48,24 @@ public function execute(): void
4848 ...$ arguments
4949 );
5050 } else {
51- $ result = call_user_func_array (
52- [
53- TypeResolver::convertPHPTypeToJavaType ($ invokerClass ),
54- $ methodName
55- ],
51+ $ reflectionClass = new \ReflectionClass ($ invokerClass );
52+ $ methodAccessor = $ reflectionClass ->getMethod ($ methodName );
53+
54+ // parse PHPDoc
55+ $ documentBlock = \phpDocumentor \Reflection \DocBlockFactory::createInstance ()
56+ ->create ($ methodAccessor ->getDocComment ());
57+
58+ // Native annotation will dependency inject.
59+ if (!empty ($ documentBlock ->getTagsByName ('native ' ))) {
60+ array_unshift (
61+ $ arguments ,
62+ $ this ->getConstantPool (),
63+ $ this ->javaClass
64+ );
65+ }
66+
67+ $ result = $ methodAccessor ->invokeArgs (
68+ $ invokerClass ,
5669 $ arguments
5770 );
5871 }
You can’t perform that action at this time.
0 commit comments