hypertube-binaries 0.0.7 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/Binaries/Clr/Hypertube.Clr.Utils.dll +0 -0
  2. package/Binaries/Clr/HypertubeClrRuntime.dll +0 -0
  3. package/Binaries/Jvm/HypertubeJvmRuntime.jar +0 -0
  4. package/Binaries/Native/Linux/ARM64/{_HypertubeNativeErrorLogger_2026-03-22.txt → _HypertubeNativeErrorLogger_2026-03-31.txt} +1 -1
  5. package/Binaries/Native/Linux/ARM64/libHypertubeActivationService.so +0 -0
  6. package/Binaries/Native/Linux/ARM64/libUtils.so +0 -0
  7. package/Binaries/Native/Linux/ARM64/version.txt +1 -1
  8. package/Binaries/Native/Linux/X64/{_HypertubeNativeErrorLogger_2026-03-22.txt → _HypertubeNativeErrorLogger_2026-03-31.txt} +1 -1
  9. package/Binaries/Native/Linux/X64/libHypertubeActivationService.so +0 -0
  10. package/Binaries/Native/Linux/X64/libHypertubeNodejs2218RuntimeNative.so +0 -0
  11. package/Binaries/Native/Linux/X64/libUtils.so +0 -0
  12. package/Binaries/Native/Linux/X64/version.txt +1 -1
  13. package/Binaries/Native/MacOs/ARM64/_HypertubeNativeErrorLogger_2026-03-31.txt +2 -0
  14. package/Binaries/Native/MacOs/ARM64/libHypertubeActivationService.dylib +0 -0
  15. package/Binaries/Native/MacOs/ARM64/libHypertubeNodejs2218RuntimeNative.dylib +0 -0
  16. package/Binaries/Native/MacOs/ARM64/libUtils.dylib +0 -0
  17. package/Binaries/Native/MacOs/ARM64/version.txt +1 -1
  18. package/Binaries/Native/MacOs/X64/{_HypertubeNativeErrorLogger_2026-03-22.txt → _HypertubeNativeErrorLogger_2026-03-31.txt} +1 -1
  19. package/Binaries/Native/MacOs/X64/libHypertubeActivationService.dylib +0 -0
  20. package/Binaries/Native/MacOs/X64/libHypertubeNodejs2218RuntimeNative.dylib +0 -0
  21. package/Binaries/Native/MacOs/X64/libUtils.dylib +0 -0
  22. package/Binaries/Native/MacOs/X64/version.txt +1 -1
  23. package/Binaries/Native/Windows/ARM64/Configs.dll +0 -0
  24. package/Binaries/Native/Windows/ARM64/HypertubeActivationService.dll +0 -0
  25. package/Binaries/Native/Windows/ARM64/HypertubeCppRuntimeNative.dll +0 -0
  26. package/Binaries/Native/Windows/ARM64/HypertubeGoRuntimeNative.dll +0 -0
  27. package/Binaries/Native/Windows/ARM64/HypertubeJvmRuntimeNative.dll +0 -0
  28. package/Binaries/Native/Windows/ARM64/HypertubeNetcoreRuntimeNative.dll +0 -0
  29. package/Binaries/Native/Windows/ARM64/HypertubePhpRuntimeNative.dll +0 -0
  30. package/Binaries/Native/Windows/ARM64/HypertubePythonRuntimeNative.dll +0 -0
  31. package/Binaries/Native/Windows/ARM64/HypertubeRubyRuntimeNative.dll +0 -0
  32. package/Binaries/Native/Windows/ARM64/HypertubeTcpClient.dll +0 -0
  33. package/Binaries/Native/Windows/ARM64/HypertubeTcpTlsClient.dll +0 -0
  34. package/Binaries/Native/Windows/ARM64/Utils.dll +0 -0
  35. package/Binaries/Native/Windows/ARM64/_HypertubeNativeErrorLogger_2026-03-31.txt +2 -0
  36. package/Binaries/Native/Windows/ARM64/version.txt +0 -0
  37. package/Binaries/Native/Windows/X64/Configs.dll +0 -0
  38. package/Binaries/Native/Windows/X64/HypertubeActivationService.dll +0 -0
  39. package/Binaries/Native/Windows/X64/HypertubeClrRuntimeNative.dll +0 -0
  40. package/Binaries/Native/Windows/X64/HypertubeCppRuntimeNative.dll +0 -0
  41. package/Binaries/Native/Windows/X64/HypertubeGoRuntimeNative.dll +0 -0
  42. package/Binaries/Native/Windows/X64/HypertubeJvmRuntimeNative.dll +0 -0
  43. package/Binaries/Native/Windows/X64/HypertubeNetcoreRuntimeNative.dll +0 -0
  44. package/Binaries/Native/Windows/X64/HypertubeNodejs2218RuntimeNative.dll +0 -0
  45. package/Binaries/Native/Windows/X64/HypertubeNodejsRuntimeNative.dll +0 -0
  46. package/Binaries/Native/Windows/X64/HypertubePhp848RuntimeNative.dll +0 -0
  47. package/Binaries/Native/Windows/X64/HypertubePhpRuntimeNative.dll +0 -0
  48. package/Binaries/Native/Windows/X64/HypertubePythonRuntimeNative.dll +0 -0
  49. package/Binaries/Native/Windows/X64/HypertubeRubyRuntimeNative.dll +0 -0
  50. package/Binaries/Native/Windows/X64/HypertubeTcpClient.dll +0 -0
  51. package/Binaries/Native/Windows/X64/HypertubeTcpTlsClient.dll +0 -0
  52. package/Binaries/Native/Windows/X64/Utils.dll +0 -0
  53. package/Binaries/Native/Windows/X64/_HypertubeNativeErrorLogger_2026-03-31.txt +2 -0
  54. package/Binaries/Native/Windows/X64/version.txt +1 -1
  55. package/Binaries/Netcore/Hypertube.Netcore.Core.dll +0 -0
  56. package/Binaries/Netcore/Hypertube.Netcore.Plugins.dll +0 -0
  57. package/Binaries/Netcore/Hypertube.Netcore.Utils.dll +0 -0
  58. package/Binaries/Php/hypertube/core/handler/AbstractHandler.php +9 -0
  59. package/Binaries/Php/hypertube/core/handler/ArrayGetRankHandler.php +1 -1
  60. package/Binaries/Php/hypertube/core/handler/ArrayGetSizeHandler.php +1 -1
  61. package/Binaries/Php/hypertube/core/handler/ArraySetItemHandler.php +2 -4
  62. package/Binaries/Php/hypertube/core/handler/CastHandler.php +2 -5
  63. package/Binaries/Php/hypertube/core/handler/ConvertTypeHandler.php +1 -7
  64. package/Binaries/Php/hypertube/core/handler/CreateInstanceHandler.php +1 -6
  65. package/Binaries/Php/hypertube/core/handler/DestructReferenceHandler.php +14 -1
  66. package/Binaries/Php/hypertube/core/handler/EnableNamespaceHandler.php +1 -7
  67. package/Binaries/Php/hypertube/core/handler/EnableTypeHandler.php +1 -4
  68. package/Binaries/Php/hypertube/core/handler/GetInstanceFieldHandler.php +1 -7
  69. package/Binaries/Php/hypertube/core/handler/GetInstanceMethodAsDelegateHandler.php +1 -7
  70. package/Binaries/Php/hypertube/core/handler/GetStaticFieldHandler.php +1 -7
  71. package/Binaries/Php/hypertube/core/handler/GetStaticMethodAsDelegateHandler.php +1 -7
  72. package/Binaries/Php/hypertube/core/handler/GetTypeHandler.php +1 -7
  73. package/Binaries/Php/hypertube/core/handler/Handler.php +5 -43
  74. package/Binaries/Php/hypertube/core/handler/InvokeDelegateHandler.php +1 -7
  75. package/Binaries/Php/hypertube/core/handler/InvokeGenericMethodHandler.php +1 -4
  76. package/Binaries/Php/hypertube/core/handler/InvokeGenericStaticMethodHandler.php +1 -7
  77. package/Binaries/Php/hypertube/core/handler/InvokeGlobalFunctionHandler.php +1 -7
  78. package/Binaries/Php/hypertube/core/handler/InvokeInstanceMethodHandler.php +2 -8
  79. package/Binaries/Php/hypertube/core/handler/InvokeStaticMethodHandler.php +1 -7
  80. package/Binaries/Php/hypertube/core/handler/LoadLibraryHandler.php +1 -7
  81. package/Binaries/Php/hypertube/core/handler/PassByValueHandler.php +103 -0
  82. package/Binaries/Php/hypertube/core/handler/PassDelegateHandler.php +1 -4
  83. package/Binaries/Php/hypertube/core/handler/ProjectResultAsDtoHandler.php +1 -4
  84. package/Binaries/Php/hypertube/core/handler/RegisterForUpdateHandler.php +2 -5
  85. package/Binaries/Php/hypertube/core/handler/ResolveInstanceHandler.php +1 -7
  86. package/Binaries/Php/hypertube/core/handler/RetrieveArrayHandler.php +48 -0
  87. package/Binaries/Php/hypertube/core/handler/SetInstanceFieldHandler.php +21 -8
  88. package/Binaries/Php/hypertube/core/handler/SetStaticFieldHandler.php +1 -7
  89. package/Binaries/Php/hypertube/core/protocol/CommandSerializer.php +1 -1
  90. package/Binaries/Php/hypertube/{core/referencecache → utils}/ArrayWrapper.php +1 -1
  91. package/Binaries/Php/hypertube/utils/Command.php +0 -5
  92. package/Binaries/Php/hypertube/utils/CommandInterface.php +0 -1
  93. package/Binaries/Php/hypertube/utils/type/CommandType.php +4 -3
  94. package/Binaries/Python/hypertube/core/handler/AbstractHandler.py +30 -1
  95. package/Binaries/Python/hypertube/core/handler/AddEventListenerHandler.py +2 -2
  96. package/Binaries/Python/hypertube/core/handler/ArrayGetItemHandler.py +3 -4
  97. package/Binaries/Python/hypertube/core/handler/ArrayGetRankHandler.py +3 -4
  98. package/Binaries/Python/hypertube/core/handler/ArrayGetSizeHandler.py +3 -4
  99. package/Binaries/Python/hypertube/core/handler/ArrayHandler.py +2 -2
  100. package/Binaries/Python/hypertube/core/handler/ArrayReferenceHandler.py +2 -2
  101. package/Binaries/Python/hypertube/core/handler/ArraySetItemHandler.py +3 -4
  102. package/Binaries/Python/hypertube/core/handler/AsDtoHandler.py +2 -2
  103. package/Binaries/Python/hypertube/core/handler/AsOutHandler.py +2 -2
  104. package/Binaries/Python/hypertube/core/handler/AsRefHandler.py +2 -2
  105. package/Binaries/Python/hypertube/core/handler/CastingHandler.py +2 -2
  106. package/Binaries/Python/hypertube/core/handler/ConvertTypeHandler.py +2 -2
  107. package/Binaries/Python/hypertube/core/handler/CreateClassInstanceHandler.py +3 -4
  108. package/Binaries/Python/hypertube/core/handler/CreateNullHandler.py +2 -2
  109. package/Binaries/Python/hypertube/core/handler/DestructReferenceHandler.py +5 -3
  110. package/Binaries/Python/hypertube/core/handler/DtoPropertyHandler.py +2 -2
  111. package/Binaries/Python/hypertube/core/handler/EnableNamespaceHandler.py +3 -4
  112. package/Binaries/Python/hypertube/core/handler/EnableTypeHandler.py +3 -4
  113. package/Binaries/Python/hypertube/core/handler/ExceptionHandler.py +2 -2
  114. package/Binaries/Python/hypertube/core/handler/GenerateLibHandler.py +2 -2
  115. package/Binaries/Python/hypertube/core/handler/GetAsyncOperationResultHandler.py +2 -2
  116. package/Binaries/Python/hypertube/core/handler/GetEnumItemHandler.py +3 -4
  117. package/Binaries/Python/hypertube/core/handler/GetEnumNameHandler.py +3 -4
  118. package/Binaries/Python/hypertube/core/handler/GetEnumValueHandler.py +3 -4
  119. package/Binaries/Python/hypertube/core/handler/GetGlobalFieldHandler.py +6 -4
  120. package/Binaries/Python/hypertube/core/handler/GetInstanceFieldHandler.py +3 -4
  121. package/Binaries/Python/hypertube/core/handler/GetInstanceMethodAsDelegateHandler.py +3 -4
  122. package/Binaries/Python/hypertube/core/handler/GetKwargHandler.py +4 -5
  123. package/Binaries/Python/hypertube/core/handler/GetModuleHandler.py +2 -2
  124. package/Binaries/Python/hypertube/core/handler/GetRefValueHandler.py +2 -2
  125. package/Binaries/Python/hypertube/core/handler/GetResultTypeHandler.py +3 -2
  126. package/Binaries/Python/hypertube/core/handler/GetStaticFieldHandler.py +3 -4
  127. package/Binaries/Python/hypertube/core/handler/GetStaticMethodAsDelegateHandler.py +3 -4
  128. package/Binaries/Python/hypertube/core/handler/GetTypeHandler.py +3 -4
  129. package/Binaries/Python/hypertube/core/handler/Handler.py +24 -28
  130. package/Binaries/Python/hypertube/core/handler/HeartBeatHandler.py +2 -2
  131. package/Binaries/Python/hypertube/core/handler/InvokeDelegateHandler.py +3 -4
  132. package/Binaries/Python/hypertube/core/handler/InvokeGenericMethodHandler.py +2 -2
  133. package/Binaries/Python/hypertube/core/handler/InvokeGenericStaticMethodHandler.py +2 -2
  134. package/Binaries/Python/hypertube/core/handler/InvokeGlobalFunctionHandler.py +7 -5
  135. package/Binaries/Python/hypertube/core/handler/InvokeInstanceMethodHandler.py +3 -4
  136. package/Binaries/Python/hypertube/core/handler/InvokeStaticMethodHandler.py +3 -4
  137. package/Binaries/Python/hypertube/core/handler/LoadLibraryHandler.py +6 -4
  138. package/Binaries/Python/hypertube/core/handler/OptimizeHandler.py +2 -2
  139. package/Binaries/Python/hypertube/core/handler/PassByValueHandler.py +58 -0
  140. package/Binaries/Python/hypertube/core/handler/PassDelegateHandler.py +3 -4
  141. package/Binaries/Python/hypertube/core/handler/PluginWrapperHandler.py +2 -2
  142. package/Binaries/Python/hypertube/core/handler/ProjectResultAsDtoHandler.py +3 -4
  143. package/Binaries/Python/hypertube/core/handler/RegisterForUpdateHandler.py +6 -4
  144. package/Binaries/Python/hypertube/core/handler/ResolveInstanceHandler.py +5 -5
  145. package/Binaries/Python/hypertube/core/handler/RetrieveArrayHandler.py +26 -3
  146. package/Binaries/Python/hypertube/core/handler/SetInstanceFieldHandler.py +23 -11
  147. package/Binaries/Python/hypertube/core/handler/SetStaticFieldHandler.py +3 -4
  148. package/Binaries/Python/hypertube/core/handler/ValueForUpdateHandler.py +2 -2
  149. package/Binaries/Python/hypertube/core/handler/ValueHandler.py +2 -2
  150. package/Binaries/Python/hypertube/core/protocol/CommandSerializer.py +1 -1
  151. package/Binaries/Python/hypertube/utils/Command.py +0 -8
  152. package/Binaries/Python/hypertube/utils/CommandType.py +4 -3
  153. package/Binaries/Ruby/core/handler/abstract_handler.rb +26 -2
  154. package/Binaries/Ruby/core/handler/add_event_listener_handler.rb +2 -2
  155. package/Binaries/Ruby/core/handler/array_get_item_handler.rb +3 -3
  156. package/Binaries/Ruby/core/handler/array_get_rank_handler.rb +3 -3
  157. package/Binaries/Ruby/core/handler/array_get_size_handler.rb +3 -3
  158. package/Binaries/Ruby/core/handler/array_handler.rb +2 -2
  159. package/Binaries/Ruby/core/handler/array_reference_handler.rb +2 -2
  160. package/Binaries/Ruby/core/handler/array_set_item_handler.rb +3 -3
  161. package/Binaries/Ruby/core/handler/as_dto_handler.rb +2 -2
  162. package/Binaries/Ruby/core/handler/as_kwargs_handler.rb +2 -2
  163. package/Binaries/Ruby/core/handler/as_out_handler.rb +2 -2
  164. package/Binaries/Ruby/core/handler/as_ref_handler.rb +2 -2
  165. package/Binaries/Ruby/core/handler/casting_handler.rb +2 -2
  166. package/Binaries/Ruby/core/handler/convert_type_handler.rb +2 -2
  167. package/Binaries/Ruby/core/handler/create_class_instance_handler.rb +3 -3
  168. package/Binaries/Ruby/core/handler/create_null_handler.rb +2 -2
  169. package/Binaries/Ruby/core/handler/destruct_reference_handler.rb +8 -2
  170. package/Binaries/Ruby/core/handler/dto_property_handler.rb +2 -2
  171. package/Binaries/Ruby/core/handler/enable_namespace_handler.rb +3 -5
  172. package/Binaries/Ruby/core/handler/enable_type_handler.rb +3 -3
  173. package/Binaries/Ruby/core/handler/exception_handler.rb +2 -2
  174. package/Binaries/Ruby/core/handler/generate_lib_handler.rb +2 -2
  175. package/Binaries/Ruby/core/handler/get_async_operation_result_handler.rb +2 -2
  176. package/Binaries/Ruby/core/handler/get_enum_item_handler.rb +2 -2
  177. package/Binaries/Ruby/core/handler/get_enum_name_handler.rb +2 -2
  178. package/Binaries/Ruby/core/handler/get_enum_value_handler.rb +2 -2
  179. package/Binaries/Ruby/core/handler/get_global_field_handler.rb +2 -2
  180. package/Binaries/Ruby/core/handler/get_instance_field_handler.rb +3 -3
  181. package/Binaries/Ruby/core/handler/get_instance_method_as_delegate_handler.rb +2 -2
  182. package/Binaries/Ruby/core/handler/get_module_handler.rb +2 -2
  183. package/Binaries/Ruby/core/handler/get_ref_value_handler.rb +2 -2
  184. package/Binaries/Ruby/core/handler/get_result_type_handler.rb +2 -2
  185. package/Binaries/Ruby/core/handler/get_static_field_handler.rb +3 -3
  186. package/Binaries/Ruby/core/handler/get_static_method_as_delegate_handler.rb +2 -2
  187. package/Binaries/Ruby/core/handler/get_type_handler.rb +3 -3
  188. package/Binaries/Ruby/core/handler/handler.rb +9 -9
  189. package/Binaries/Ruby/core/handler/heartbeat_handler.rb +2 -2
  190. package/Binaries/Ruby/core/handler/invoke_delegate_handler.rb +2 -2
  191. package/Binaries/Ruby/core/handler/invoke_generic_method_handler.rb +2 -2
  192. package/Binaries/Ruby/core/handler/invoke_generic_static_method_handler.rb +2 -2
  193. package/Binaries/Ruby/core/handler/invoke_global_function_handler.rb +2 -2
  194. package/Binaries/Ruby/core/handler/invoke_instance_method_handler.rb +3 -5
  195. package/Binaries/Ruby/core/handler/invoke_static_method_handler.rb +3 -3
  196. package/Binaries/Ruby/core/handler/load_library_handler.rb +5 -10
  197. package/Binaries/Ruby/core/handler/optimize_handler.rb +2 -2
  198. package/Binaries/Ruby/core/handler/pass_by_value_handler.rb +56 -0
  199. package/Binaries/Ruby/core/handler/pass_delegate_handler.rb +2 -2
  200. package/Binaries/Ruby/core/handler/plugin_wrapper_handler.rb +2 -2
  201. package/Binaries/Ruby/core/handler/project_result_as_dto_handler.rb +4 -2
  202. package/Binaries/Ruby/core/handler/register_for_update_handler.rb +3 -5
  203. package/Binaries/Ruby/core/handler/resolve_instance_handler.rb +4 -5
  204. package/Binaries/Ruby/core/handler/retrieve_array_handler.rb +31 -4
  205. package/Binaries/Ruby/core/handler/set_instance_field_handler.rb +19 -11
  206. package/Binaries/Ruby/core/handler/set_static_field_handler.rb +3 -5
  207. package/Binaries/Ruby/core/handler/value_for_update_handler.rb +2 -2
  208. package/Binaries/Ruby/core/handler/value_handler.rb +2 -2
  209. package/Binaries/Ruby/core/protocol/command_serializer.rb +1 -1
  210. package/Binaries/Ruby/utils/command.rb +0 -4
  211. package/Binaries/Ruby/utils/command_type.rb +6 -3
  212. package/Binaries/version.txt +1 -1
  213. package/package.json +1 -1
  214. package/prebuilds/prebuilds-darwin-arm64/HypertubeNodejsRuntimeAddon.node +0 -0
  215. package/prebuilds/prebuilds-darwin-x64/HypertubeNodejsRuntimeAddon.node +0 -0
  216. package/prebuilds/prebuilds-win32-arm64/HypertubeNodejsRuntimeAddon.node +0 -0
  217. package/prebuilds/prebuilds-win32-x64/HypertubeNodejsRuntimeAddon.node +0 -0
  218. package/Binaries/Native/MacOs/ARM64/_HypertubeNativeErrorLogger_2026-03-22.txt +0 -2
  219. package/Binaries/Native/Windows/ARM64/_HypertubeNativeErrorLogger_2026-03-22.txt +0 -2
  220. package/Binaries/Native/Windows/X64/_HypertubeNativeErrorLogger_2026-03-22.txt +0 -2
  221. package/Binaries/Python/hypertube/core/handler/AbstractCommandHandler.py +0 -20
  222. package/Binaries/Ruby/core/handler/abstract_command_handler.rb +0 -24
@@ -1,2 +1,2 @@
1
- 2026-03-22 11:22:39 Thread ID: 262979988167200 Configuration source is not a valid JSON. Check your configuration:
1
+ 2026-03-31 14:03:08 Thread ID: 278562404543008 Configuration source is not a valid JSON. Check your configuration:
2
2
  ./config2.json
@@ -1 +1 @@
1
- 0.0.7
1
+ 3.0.1
@@ -1,2 +1,2 @@
1
- 2026-03-22 11:15:25 Thread ID: 140038331676480 Configuration source is not a valid JSON. Check your configuration:
1
+ 2026-03-31 14:03:58 Thread ID: 140496838338368 Configuration source is not a valid JSON. Check your configuration:
2
2
  ./config2.json
@@ -1 +1 @@
1
- 0.0.7
1
+ 3.0.1
@@ -0,0 +1,2 @@
1
+ 2026-03-31 15:59:13 Thread ID: 0x1e847d000 Configuration source is not a valid JSON. Check your configuration:
2
+ ./config2.json
@@ -1 +1 @@
1
- 0.0.7
1
+ 3.0.1
@@ -1,2 +1,2 @@
1
- 2026-03-22 11:16:48 Thread ID: 0x7ff84fe85840 Configuration source is not a valid JSON. Check your configuration:
1
+ 2026-03-31 14:04:52 Thread ID: 0x7ff849b8c840 Configuration source is not a valid JSON. Check your configuration:
2
2
  ./config2.json
@@ -1 +1 @@
1
- 0.0.7
1
+ 3.0.1
@@ -0,0 +1,2 @@
1
+ 2026-03-31 14:01:23 Thread ID: 4032 Configuration source is not a valid JSON. Check your configuration:
2
+ ./config2.json
@@ -0,0 +1,2 @@
1
+ 2026-03-31 14:05:28 Thread ID: 6992 Configuration source is not a valid JSON. Check your configuration:
2
+ ./config2.json
@@ -1 +1 @@
1
- '0.0.7'
1
+ '3.0.1'
@@ -5,6 +5,7 @@ declare(strict_types=1);
5
5
  namespace core\handler;
6
6
 
7
7
  use utils\CommandInterface;
8
+ use utils\exception\HypertubeArgumentsMismatchException;
8
9
  use utils\type\CommandType;
9
10
 
10
11
  abstract class AbstractHandler
@@ -49,4 +50,12 @@ abstract class AbstractHandler
49
50
  }
50
51
  }
51
52
  }
53
+
54
+ protected function validate(CommandInterface $command, int $requiredParametersCount, string $callerTypeName): void
55
+ {
56
+ if ($command->getPayloadSize() < $requiredParametersCount) {
57
+ throw new HypertubeArgumentsMismatchException($callerTypeName, $requiredParametersCount);
58
+ }
59
+ }
60
+
52
61
  }
@@ -5,7 +5,7 @@ declare(strict_types=1);
5
5
  namespace core\handler;
6
6
 
7
7
  use ArrayAccess;
8
- use core\referencecache\ArrayWrapper;
8
+ use utils\ArrayWrapper;
9
9
  use utils\CommandInterface;
10
10
 
11
11
  final class ArrayGetRankHandler extends AbstractHandler
@@ -5,8 +5,8 @@ declare(strict_types=1);
5
5
  namespace core\handler;
6
6
 
7
7
  use Countable;
8
- use core\referencecache\ArrayWrapper;
9
8
  use Exception;
9
+ use utils\ArrayWrapper;
10
10
  use utils\CommandInterface;
11
11
 
12
12
  final class ArrayGetSizeHandler extends AbstractHandler
@@ -5,8 +5,8 @@ declare(strict_types=1);
5
5
  namespace core\handler;
6
6
 
7
7
  use ArrayAccess;
8
- use core\referencecache\ArrayWrapper;
9
8
  use Exception;
9
+ use utils\ArrayWrapper;
10
10
  use utils\CommandInterface;
11
11
 
12
12
  final class ArraySetItemHandler extends AbstractHandler
@@ -19,9 +19,7 @@ final class ArraySetItemHandler extends AbstractHandler
19
19
  public function process(CommandInterface $command)
20
20
  {
21
21
  try {
22
- if ($command->getPayloadSize() < self::REQUIRED_PARAMETERS_COUNT) {
23
- throw new Exception('ArraySetItemHandler parameters mismatch!');
24
- }
22
+ $this->validate($command, self::REQUIRED_PARAMETERS_COUNT, self::class);
25
23
 
26
24
  $payload = $command->getPayload();
27
25
  $data = $payload[0];
@@ -6,7 +6,6 @@ namespace core\handler;
6
6
 
7
7
  use TypeError;
8
8
  use utils\CommandInterface;
9
- use utils\exception\HypertubeArgumentsMismatchException;
10
9
 
11
10
  final class CastHandler extends AbstractHandler
12
11
  {
@@ -17,11 +16,9 @@ final class CastHandler extends AbstractHandler
17
16
  */
18
17
  public function process(CommandInterface $command)
19
18
  {
20
- $payload = $command->getPayload();
21
- if ($command->getPayloadSize() !== self::REQUIRED_ARGUMENTS_COUNT) {
22
- throw new HypertubeArgumentsMismatchException(self::class, self::REQUIRED_ARGUMENTS_COUNT);
23
- }
19
+ $this->validate($command, self::REQUIRED_ARGUMENTS_COUNT, self::class);
24
20
 
21
+ $payload = $command->getPayload();
25
22
  $newType = $payload[0];
26
23
  $value = $payload[1];
27
24
 
@@ -5,7 +5,6 @@ declare(strict_types=1);
5
5
  namespace core\handler;
6
6
 
7
7
  use utils\CommandInterface;
8
- use utils\exception\HypertubeArgumentsMismatchException;
9
8
  use utils\TypesHandler;
10
9
 
11
10
  final class ConvertTypeHandler extends AbstractHandler
@@ -14,12 +13,7 @@ final class ConvertTypeHandler extends AbstractHandler
14
13
 
15
14
  public function process(CommandInterface $command): string
16
15
  {
17
- if ($command->getPayloadSize() !== self::REQUIRED_ARGUMENTS_COUNT) {
18
- throw new HypertubeArgumentsMismatchException(
19
- self::class,
20
- self::REQUIRED_ARGUMENTS_COUNT
21
- );
22
- }
16
+ $this->validate($command, self::REQUIRED_ARGUMENTS_COUNT, self::class);
23
17
 
24
18
  return TypesHandler::convertTypeToHypertubeType($command->getPayload()[0]);
25
19
  }
@@ -10,7 +10,6 @@ use ReflectionException;
10
10
  use ReflectionMethod;
11
11
  use ReflectionType;
12
12
  use utils\CommandInterface;
13
- use utils\exception\HypertubeArgumentsMismatchException;
14
13
 
15
14
  final class CreateInstanceHandler extends AbstractHandler
16
15
  {
@@ -21,11 +20,7 @@ final class CreateInstanceHandler extends AbstractHandler
21
20
  */
22
21
  public function process(CommandInterface $command)
23
22
  {
24
- if ($command->getPayloadSize() < self::REQUIRED_ARGUMENTS_COUNT) {
25
- throw new HypertubeArgumentsMismatchException(
26
- self::class, self::REQUIRED_ARGUMENTS_COUNT
27
- );
28
- }
23
+ $this->validate($command, self::REQUIRED_ARGUMENTS_COUNT, self::class);
29
24
 
30
25
  $payload = $command->getPayload();
31
26
  $arguments = [];
@@ -11,6 +11,19 @@ final class DestructReferenceHandler extends AbstractHandler
11
11
  {
12
12
  public function process(CommandInterface $command): bool
13
13
  {
14
- return ReferencesCache::getInstance()->deleteReference((string) $command->getPayload()[0]);
14
+ try {
15
+ if ($command->getPayloadSize() < 1) {
16
+ return false;
17
+ }
18
+
19
+ $referenceId = $command->getPayload()[0] ?? null;
20
+ if (!is_string($referenceId)) {
21
+ return false;
22
+ }
23
+
24
+ return ReferencesCache::getInstance()->deleteReference($referenceId);
25
+ } catch (\Throwable $e) {
26
+ return false;
27
+ }
15
28
  }
16
29
  }
@@ -6,7 +6,6 @@ namespace core\handler;
6
6
 
7
7
  use core\namespacescache\NamespacesCache;
8
8
  use utils\CommandInterface;
9
- use utils\exception\HypertubeArgumentsMismatchException;
10
9
 
11
10
  final class EnableNamespaceHandler extends AbstractHandler
12
11
  {
@@ -14,12 +13,7 @@ final class EnableNamespaceHandler extends AbstractHandler
14
13
 
15
14
  public function process(CommandInterface $command): int
16
15
  {
17
- if ($command->getPayloadSize() < self::REQUIRED_ARGUMENTS_COUNT) {
18
- throw new HypertubeArgumentsMismatchException(
19
- self::class,
20
- self::REQUIRED_ARGUMENTS_COUNT
21
- );
22
- }
16
+ $this->validate($command, self::REQUIRED_ARGUMENTS_COUNT, self::class);
23
17
 
24
18
  $namespacesCache = NamespacesCache::getInstance();
25
19
 
@@ -6,7 +6,6 @@ namespace core\handler;
6
6
 
7
7
  use core\typescache\TypesCache;
8
8
  use utils\CommandInterface;
9
- use utils\exception\HypertubeArgumentsMismatchException;
10
9
 
11
10
  final class EnableTypeHandler extends AbstractHandler
12
11
  {
@@ -14,9 +13,7 @@ final class EnableTypeHandler extends AbstractHandler
14
13
 
15
14
  public function process(CommandInterface $command): int
16
15
  {
17
- if (count($command->getPayload()) < self::REQUIRED_ARGUMENTS_COUNT) {
18
- throw new HypertubeArgumentsMismatchException(self::class, self::REQUIRED_ARGUMENTS_COUNT);
19
- }
16
+ $this->validate($command, self::REQUIRED_ARGUMENTS_COUNT, self::class);
20
17
 
21
18
  $typesCache = TypesCache::getInstance();
22
19
  foreach ($command->getPayload() as $payload) {
@@ -9,7 +9,6 @@ use ReflectionException;
9
9
  use Exception;
10
10
  use SebastianBergmann\CodeCoverage\Report\PHP;
11
11
  use utils\CommandInterface;
12
- use utils\exception\HypertubeArgumentsMismatchException;
13
12
 
14
13
  final class GetInstanceFieldHandler extends AbstractHandler
15
14
  {
@@ -20,12 +19,7 @@ final class GetInstanceFieldHandler extends AbstractHandler
20
19
  */
21
20
  public function process(CommandInterface $command)
22
21
  {
23
- if ($command->getPayloadSize() < self::REQUIRED_ARGUMENTS_COUNT) {
24
- throw new HypertubeArgumentsMismatchException(
25
- self::class,
26
- self::REQUIRED_ARGUMENTS_COUNT
27
- );
28
- }
22
+ $this->validate($command, self::REQUIRED_ARGUMENTS_COUNT, self::class);
29
23
 
30
24
  $objectClass = $command->getPayload()[0];
31
25
  $fieldString = (string)$command->getPayload()[1];
@@ -8,7 +8,6 @@ use ReflectionClass;
8
8
  use ReflectionException;
9
9
  use ReflectionMethod;
10
10
  use utils\CommandInterface;
11
- use utils\exception\HypertubeArgumentsMismatchException;
12
11
 
13
12
  final class GetInstanceMethodAsDelegateHandler extends AbstractHandler
14
13
  {
@@ -16,12 +15,7 @@ final class GetInstanceMethodAsDelegateHandler extends AbstractHandler
16
15
 
17
16
  public function process(CommandInterface $command): ReflectionMethod
18
17
  {
19
- if ($command->getPayloadSize() < self::REQUIRED_ARGUMENTS_COUNT) {
20
- throw new HypertubeArgumentsMismatchException(
21
- self::class,
22
- self::REQUIRED_ARGUMENTS_COUNT
23
- );
24
- }
18
+ $this->validate($command, self::REQUIRED_ARGUMENTS_COUNT, self::class);
25
19
 
26
20
  $objectInstance = $command->getPayload()[0];
27
21
  $methodToInvoke = (string) $command->getPayload()[1];
@@ -8,7 +8,6 @@ use Exception;
8
8
  use ReflectionClass;
9
9
  use ReflectionException;
10
10
  use utils\CommandInterface;
11
- use utils\exception\HypertubeArgumentsMismatchException;
12
11
 
13
12
  final class GetStaticFieldHandler extends AbstractHandler
14
13
  {
@@ -19,12 +18,7 @@ final class GetStaticFieldHandler extends AbstractHandler
19
18
  */
20
19
  public function process(CommandInterface $command)
21
20
  {
22
- if ($command->getPayloadSize() < self::REQUIRED_ARGUMENTS_COUNT) {
23
- throw new HypertubeArgumentsMismatchException(
24
- self::class,
25
- self::REQUIRED_ARGUMENTS_COUNT
26
- );
27
- }
21
+ $this->validate($command, self::REQUIRED_ARGUMENTS_COUNT, self::class);
28
22
 
29
23
  $classToLoad = $command->getPayload()[0];
30
24
  $field = (string) $command->getPayload()[1];
@@ -9,7 +9,6 @@ use ReflectionException;
9
9
  use ReflectionMethod;
10
10
  use ReflectionType;
11
11
  use utils\CommandInterface;
12
- use utils\exception\HypertubeArgumentsMismatchException;
13
12
 
14
13
  final class GetStaticMethodAsDelegateHandler extends AbstractHandler
15
14
  {
@@ -17,12 +16,7 @@ final class GetStaticMethodAsDelegateHandler extends AbstractHandler
17
16
 
18
17
  public function process(CommandInterface $command): ReflectionMethod
19
18
  {
20
- if ($command->getPayloadSize() < self::REQUIRED_ARGUMENTS_COUNT) {
21
- throw new HypertubeArgumentsMismatchException(
22
- self::class,
23
- self::REQUIRED_ARGUMENTS_COUNT
24
- );
25
- }
19
+ $this->validate($command, self::REQUIRED_ARGUMENTS_COUNT, self::class);
26
20
 
27
21
  $payload = $command->getPayload();
28
22
  $classToLoad = $payload[0];
@@ -10,7 +10,6 @@ use core\typescache\TypesCache;
10
10
  use Exception;
11
11
  use ReflectionClass;
12
12
  use utils\CommandInterface;
13
- use utils\exception\HypertubeArgumentsMismatchException;
14
13
 
15
14
  final class GetTypeHandler extends AbstractHandler
16
15
  {
@@ -36,12 +35,7 @@ final class GetTypeHandler extends AbstractHandler
36
35
 
37
36
  public function process(CommandInterface $command)
38
37
  {
39
- if ($command->getPayloadSize() < self::REQUIRED_ARGUMENTS_COUNT) {
40
- throw new HypertubeArgumentsMismatchException(
41
- self::class,
42
- self::REQUIRED_ARGUMENTS_COUNT
43
- );
44
- }
38
+ $this->validate($command, self::REQUIRED_ARGUMENTS_COUNT, self::class);
45
39
 
46
40
  $typeName = $this->getTypeName($command);
47
41
 
@@ -4,17 +4,15 @@ declare(strict_types=1);
4
4
 
5
5
  namespace core\handler;
6
6
 
7
- use ArrayObject;
8
7
  use core\referencecache\ReferencesCache;
9
- use core\referencecache\ArrayWrapper;
10
8
  use Throwable;
11
- use TypeError;
12
9
  use utils\Command;
13
10
  use utils\CommandInterface;
14
11
  use utils\ExceptionSerializer;
15
12
  use utils\RuntimeName;
16
13
  use utils\type\CommandType;
17
14
  use utils\TypesHandler;
15
+ use utils\ArrayWrapper;
18
16
 
19
17
  final class Handler
20
18
  {
@@ -54,7 +52,7 @@ final class Handler
54
52
  self::$handlers[CommandType::ARRAY_GET_RANK()->getValue()] = new ArrayGetRankHandler();
55
53
  self::$handlers[CommandType::ARRAY_SET_ITEM()->getValue()] = new ArraySetItemHandler();
56
54
  self::$handlers[CommandType::ARRAY()->getValue()] = new ArrayHandler();
57
- self::$handlers[CommandType::RETRIEVE_ARRAY()->getValue()] = null; // obsługiwane osobno
55
+ self::$handlers[CommandType::RETRIEVE_ARRAY()->getValue()] = new RetrieveArrayHandler();
58
56
  self::$handlers[CommandType::SET_INSTANCE_FIELD()->getValue()] = new SetInstanceFieldHandler();
59
57
  self::$handlers[CommandType::INVOKE_GENERIC_STATIC_METHOD()->getValue()] = new InvokeGenericStaticMethodHandler();
60
58
  self::$handlers[CommandType::INVOKE_GENERIC_METHOD()->getValue()] = new InvokeGenericMethodHandler();
@@ -83,6 +81,7 @@ final class Handler
83
81
  self::$handlers[CommandType::AS_DTO()->getValue()] = new AsDtoHandler();
84
82
  self::$handlers[CommandType::DTO_PROPERTY()->getValue()] = new DtoPropertyHandler();
85
83
  self::$handlers[CommandType::PROJECT_RESULT_AS_DTO()->getValue()] = new ProjectResultAsDtoHandler();
84
+ self::$handlers[CommandType::PASS_BY_VALUE()->getValue()] = new PassByValueHandler();
86
85
  }
87
86
 
88
87
  public static function getHandlers(): array
@@ -95,17 +94,9 @@ final class Handler
95
94
  {
96
95
  self::initializeHandlers();
97
96
  try {
98
- if ($command->getCommandType()->equalsByValue(CommandType::RETRIEVE_ARRAY)) {
99
- return self::handleRetrieveArrayCommand($command);
100
- }
101
-
102
97
  $response = self::$handlers[$command->getCommandType()->getValue()]
103
98
  ->handleCommand($command);
104
99
 
105
- if ($command->getCommandType()->equalsByValue(CommandType::PROJECT_RESULT_AS_DTO)) {
106
- return Command::createArrayResponse($response, $command->getRuntimeName());
107
- }
108
-
109
100
  return self::parseResponse($response, $command->getRuntimeName());
110
101
  } catch (Throwable $e) {
111
102
  if ($e->getPrevious() !== null) {
@@ -116,37 +107,6 @@ final class Handler
116
107
  }
117
108
  }
118
109
 
119
- private static function handleRetrieveArrayCommand(CommandInterface $command): CommandInterface
120
- {
121
- $response = self::$handlers[CommandType::REFERENCE()->getValue()]->handleCommand($command->getPayload()[0]);
122
-
123
- if ($response instanceof ArrayWrapper) {
124
- return Command::createArrayResponse(
125
- $response->getData(),
126
- $command->getRuntimeName()
127
- );
128
- }
129
-
130
- if ($response instanceof ArrayObject) {
131
- return Command::createArrayResponse(
132
- $response->getArrayCopy(),
133
- $command->getRuntimeName()
134
- );
135
- }
136
-
137
- if (is_array($response)) {
138
- return Command::createArrayResponse(
139
- $response,
140
- $command->getRuntimeName()
141
- );
142
- }
143
-
144
- throw new TypeError(sprintf(
145
- 'Expected array, ArrayObject or ArrayWrapper for RETRIEVE_ARRAY, got %s',
146
- is_object($response) ? get_class($response) : gettype($response)
147
- ));
148
- }
149
-
150
110
  /**
151
111
  * @param mixed $response
152
112
  */
@@ -157,6 +117,8 @@ final class Handler
157
117
  $response,
158
118
  $runtimeName
159
119
  );
120
+ } elseif ($response instanceof CommandInterface) {
121
+ $responseCommand = $response;
160
122
  } else {
161
123
  if (is_array($response)) {
162
124
  $response = new ArrayWrapper($response);
@@ -6,7 +6,6 @@ namespace core\handler;
6
6
 
7
7
  use core\delegatecache\DelegatesCache;
8
8
  use utils\CommandInterface;
9
- use utils\exception\HypertubeArgumentsMismatchException;
10
9
 
11
10
  final class InvokeDelegateHandler extends AbstractHandler
12
11
  {
@@ -17,12 +16,7 @@ final class InvokeDelegateHandler extends AbstractHandler
17
16
  */
18
17
  public function process(CommandInterface $command)
19
18
  {
20
- if ($command->getPayloadSize() < self::REQUIRED_ARGUMENTS_COUNT) {
21
- throw new HypertubeArgumentsMismatchException(
22
- self::class,
23
- self::REQUIRED_ARGUMENTS_COUNT
24
- );
25
- }
19
+ $this->validate($command, self::REQUIRED_ARGUMENTS_COUNT, self::class);
26
20
 
27
21
  $guid = (string) $command->getPayload()[0];
28
22
  $delegate = DelegatesCache::getInstance()->getDelegate($guid);
@@ -5,7 +5,6 @@ declare(strict_types=1);
5
5
  namespace core\handler;
6
6
 
7
7
  use utils\CommandInterface;
8
- use utils\exception\HypertubeArgumentsMismatchException;
9
8
  use ReflectionClass;
10
9
  use ReflectionException;
11
10
 
@@ -18,9 +17,7 @@ final class InvokeGenericMethodHandler extends AbstractHandler
18
17
  */
19
18
  public function process(CommandInterface $command)
20
19
  {
21
- if ($command->getPayloadSize() < self::REQUIRED_ARGUMENTS_COUNT) {
22
- throw new HypertubeArgumentsMismatchException(self::class, self::REQUIRED_ARGUMENTS_COUNT);
23
- }
20
+ $this->validate($command, self::REQUIRED_ARGUMENTS_COUNT, self::class);
24
21
 
25
22
  $objectOrClass = $command->getPayload()[0];
26
23
  $methodToInvoke = $command->getPayload()[1];