File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66use PHPJava \Exceptions \UnableToCatchException ;
77use PHPJava \Kernel \Attributes \CodeAttribute ;
88use PHPJava \Kernel \Structures \_ExceptionTable ;
9+ use PHPJava \Utilities \AttributionResolver ;
910use PHPJava \Utilities \BinaryTool ;
1011use PHPJava \Utilities \Formatter ;
1112use PHPJava \Utilities \MethodNameResolver ;
@@ -26,8 +27,8 @@ public function execute(): void
2627 $ parsedSignature = Formatter::parseSignature ($ signature );
2728 $ invokerClass = $ this ->popFromOperandStack ();
2829
29- $ arguments = [];
3030
31+ $ arguments = array_fill (0 , $ parsedSignature ['arguments_count ' ] - 1 , null );
3132 for ($ i = $ parsedSignature ['arguments_count ' ] - 1 ; $ i >= 0 ; $ i --) {
3233 $ arguments [$ i ] = $ this ->popFromOperandStack ();
3334 }
@@ -61,21 +62,6 @@ public function execute(): void
6162 ...$ arguments
6263 );
6364 } else {
64- $ reflectionClass = new \ReflectionClass (
65- $ realInvokerClass = TypeResolver::convertPHPTypeToJavaType ($ invokerClass )
66- );
67- $ methodAccessor = $ reflectionClass ->getMethod ($ methodName );
68-
69- if ($ document = $ methodAccessor ->getDocComment ()) {
70- $ prependInjections = $ this ->getNativeAnnotateInjections ($ document );
71- if (!empty ($ prependInjections )) {
72- array_unshift (
73- $ arguments ,
74- ...$ prependInjections
75- );
76- }
77- }
78-
7965 $ result = call_user_func_array (
8066 [
8167 $ invokerClass ,
Original file line number Diff line number Diff line change @@ -24,13 +24,13 @@ public function execute(): void
2424 $ cp = $ cpInfo [$ this ->readUnsignedShort ()];
2525 $ methodName = $ cpInfo [$ cpInfo [$ cp ->getNameAndTypeIndex ()]->getNameIndex ()]->getString ();
2626 $ signature = Formatter::parseSignature ($ cpInfo [$ cpInfo [$ cp ->getNameAndTypeIndex ()]->getDescriptorIndex ()]->getString ());
27- $ arguments = [];
2827
2928 $ this ->getOptions ('class_resolver ' )
3029 ->resolve ($ cpInfo [$ cpInfo [$ cp ->getClassIndex ()]->getClassIndex ()]->getString ());
3130 [$ resourceType , $ classObject ] = $ this ->getOptions ('class_resolver ' )
3231 ->resolve ($ cpInfo [$ cpInfo [$ cp ->getClassIndex ()]->getClassIndex ()]->getString ());
3332
33+ $ arguments = array_fill (0 , $ signature ['arguments_count ' ] - 1 , null );
3434 for ($ i = $ signature ['arguments_count ' ] - 1 ; $ i >= 0 ; $ i --) {
3535 $ arguments [$ i ] = $ this ->popFromOperandStack ();
3636 }
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ public function execute(): void
2828
2929 // signature
3030 $ signature = Formatter::parseSignature ($ cpInfo [$ nameAndTypeIndex ->getDescriptorIndex ()]->getString ());
31- $ arguments = [];
3231
32+ $ arguments = array_fill (0 , $ signature ['arguments_count ' ] - 1 , null );
3333 for ($ i = $ signature ['arguments_count ' ] - 1 ; $ i >= 0 ; $ i --) {
3434 $ arguments [$ i ] = $ this ->popFromOperandStack ();
3535 }
Original file line number Diff line number Diff line change @@ -13,10 +13,7 @@ class Type
1313 public function __construct ($ value )
1414 {
1515 // Validate value which is scalar.
16- if (!is_int ($ value ) &&
17- !is_float ($ value ) &&
18- !is_string ($ value ) &&
19- !is_bool ($ value ) &&
16+ if (!is_scalar ($ value ) &&
2017 !is_array ($ value ) &&
2118 !is_null ($ value ) &&
2219 !($ value instanceof self)
You can’t perform that action at this time.
0 commit comments