hypertube-binaries 3.0.2 → 3.0.4
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.
- package/Binaries/Clr/Hypertube.Clr.Utils.dll +0 -0
- package/Binaries/Clr/HypertubeClrRuntime.dll +0 -0
- package/Binaries/Jvm/HypertubeJvmRuntime.jar +0 -0
- package/Binaries/Native/Linux/ARM64/NetVersionLatest.runtimeconfig.json +2 -2
- package/Binaries/Native/Linux/ARM64/_HypertubeNativeErrorLogger_2026-05-06.txt +124 -0
- package/Binaries/Native/Linux/ARM64/libConfigs.so +0 -0
- package/Binaries/Native/Linux/ARM64/libHypertubeActivationService.so +0 -0
- package/Binaries/Native/Linux/ARM64/libHypertubeCppRuntimeNative.so +0 -0
- package/Binaries/Native/Linux/ARM64/libHypertubeGoRuntimeNative.so +0 -0
- package/Binaries/Native/Linux/ARM64/libHypertubeJvmRuntimeNative.so +0 -0
- package/Binaries/Native/Linux/ARM64/libHypertubeNetcoreRuntimeNative.so +0 -0
- package/Binaries/Native/Linux/ARM64/libHypertubePhpRuntimeNative.so +0 -0
- package/Binaries/Native/Linux/ARM64/libHypertubePythonRuntimeNative.so +0 -0
- package/Binaries/Native/Linux/ARM64/libHypertubeRubyRuntimeNative.so +0 -0
- package/Binaries/Native/Linux/ARM64/libHypertubeTcpClient.so +0 -0
- package/Binaries/Native/Linux/ARM64/libHypertubeTcpTlsClient.so +0 -0
- package/Binaries/Native/Linux/ARM64/libUtils.so +0 -0
- package/Binaries/Native/Linux/ARM64/version.txt +1 -1
- package/Binaries/Native/Linux/X64/NetVersionLatest.runtimeconfig.json +2 -2
- package/Binaries/Native/Linux/X64/_HypertubeNativeErrorLogger_2026-05-06.txt +124 -0
- package/Binaries/Native/Linux/X64/libConfigs.so +0 -0
- package/Binaries/Native/Linux/X64/libHypertubeActivationService.so +0 -0
- package/Binaries/Native/Linux/X64/libHypertubeCppRuntimeNative.so +0 -0
- package/Binaries/Native/Linux/X64/libHypertubeGoRuntimeNative.so +0 -0
- package/Binaries/Native/Linux/X64/libHypertubeJvmRuntimeNative.so +0 -0
- package/Binaries/Native/Linux/X64/libHypertubeNetcoreRuntimeNative.so +0 -0
- package/Binaries/Native/Linux/X64/libHypertubeNodejs2218RuntimeNative.so +0 -0
- package/Binaries/Native/Linux/X64/libHypertubeNodejsRuntimeNative.so +0 -0
- package/Binaries/Native/Linux/X64/libHypertubePhp848RuntimeNative.so +0 -0
- package/Binaries/Native/Linux/X64/libHypertubePhpRuntimeNative.so +0 -0
- package/Binaries/Native/Linux/X64/libHypertubePythonRuntimeNative.so +0 -0
- package/Binaries/Native/Linux/X64/libHypertubeRubyRuntimeNative.so +0 -0
- package/Binaries/Native/Linux/X64/libHypertubeTcpClient.so +0 -0
- package/Binaries/Native/Linux/X64/libHypertubeTcpTlsClient.so +0 -0
- package/Binaries/Native/Linux/X64/libUtils.so +0 -0
- package/Binaries/Native/Linux/X64/version.txt +1 -1
- package/Binaries/Native/MacOs/ARM64/NetVersionLatest.runtimeconfig.json +2 -2
- package/Binaries/Native/MacOs/ARM64/_HypertubeNativeErrorLogger_2026-05-06.txt +124 -0
- package/Binaries/Native/MacOs/ARM64/libConfigs.dylib +0 -0
- package/Binaries/Native/MacOs/ARM64/libHypertubeActivationService.dylib +0 -0
- package/Binaries/Native/MacOs/ARM64/libHypertubeCppRuntimeNative.dylib +0 -0
- package/Binaries/Native/MacOs/ARM64/libHypertubeGoRuntimeNative.dylib +0 -0
- package/Binaries/Native/MacOs/ARM64/libHypertubeJvmRuntimeNative.dylib +0 -0
- package/Binaries/Native/MacOs/ARM64/libHypertubeNetcoreRuntimeNative.dylib +0 -0
- package/Binaries/Native/MacOs/ARM64/libHypertubeNodejs2218RuntimeNative.dylib +0 -0
- package/Binaries/Native/MacOs/ARM64/libHypertubeNodejsRuntimeNative.dylib +0 -0
- package/Binaries/Native/MacOs/ARM64/libHypertubePythonRuntimeNative.dylib +0 -0
- package/Binaries/Native/MacOs/ARM64/libHypertubeRubyRuntimeNative.dylib +0 -0
- package/Binaries/Native/MacOs/ARM64/libHypertubeTcpClient.dylib +0 -0
- package/Binaries/Native/MacOs/ARM64/libHypertubeTcpTlsClient.dylib +0 -0
- package/Binaries/Native/MacOs/ARM64/libUtils.dylib +0 -0
- package/Binaries/Native/MacOs/ARM64/version.txt +1 -1
- package/Binaries/Native/MacOs/X64/NetVersionLatest.runtimeconfig.json +2 -2
- package/Binaries/Native/MacOs/X64/_HypertubeNativeErrorLogger_2026-05-06.txt +124 -0
- package/Binaries/Native/MacOs/X64/libConfigs.dylib +0 -0
- package/Binaries/Native/MacOs/X64/libHypertubeActivationService.dylib +0 -0
- package/Binaries/Native/MacOs/X64/libHypertubeCppRuntimeNative.dylib +0 -0
- package/Binaries/Native/MacOs/X64/libHypertubeGoRuntimeNative.dylib +0 -0
- package/Binaries/Native/MacOs/X64/libHypertubeJvmRuntimeNative.dylib +0 -0
- package/Binaries/Native/MacOs/X64/libHypertubeNetcoreRuntimeNative.dylib +0 -0
- package/Binaries/Native/MacOs/X64/libHypertubeNodejs2218RuntimeNative.dylib +0 -0
- package/Binaries/Native/MacOs/X64/libHypertubeNodejsRuntimeNative.dylib +0 -0
- package/Binaries/Native/MacOs/X64/libHypertubePhp848RuntimeNative.dylib +0 -0
- package/Binaries/Native/MacOs/X64/libHypertubePhpRuntimeNative.dylib +0 -0
- package/Binaries/Native/MacOs/X64/libHypertubePythonRuntimeNative.dylib +0 -0
- package/Binaries/Native/MacOs/X64/libHypertubeRubyRuntimeNative.dylib +0 -0
- package/Binaries/Native/MacOs/X64/libHypertubeTcpClient.dylib +0 -0
- package/Binaries/Native/MacOs/X64/libHypertubeTcpTlsClient.dylib +0 -0
- package/Binaries/Native/MacOs/X64/libUtils.dylib +0 -0
- package/Binaries/Native/MacOs/X64/version.txt +1 -1
- package/Binaries/Native/Windows/ARM64/Configs.dll +0 -0
- package/Binaries/Native/Windows/ARM64/HypertubeActivationService.dll +0 -0
- package/Binaries/Native/Windows/ARM64/HypertubeCppRuntimeNative.dll +0 -0
- package/Binaries/Native/Windows/ARM64/HypertubeGoRuntimeNative.dll +0 -0
- package/Binaries/Native/Windows/ARM64/HypertubeJvmRuntimeNative.dll +0 -0
- package/Binaries/Native/Windows/ARM64/HypertubeNetcoreRuntimeNative.dll +0 -0
- package/Binaries/Native/Windows/ARM64/HypertubePhpRuntimeNative.dll +0 -0
- package/Binaries/Native/Windows/ARM64/HypertubePythonRuntimeNative.dll +0 -0
- package/Binaries/Native/Windows/ARM64/HypertubeRubyRuntimeNative.dll +0 -0
- package/Binaries/Native/Windows/ARM64/HypertubeTcpClient.dll +0 -0
- package/Binaries/Native/Windows/ARM64/HypertubeTcpTlsClient.dll +0 -0
- package/Binaries/Native/Windows/ARM64/NetVersionLatest.runtimeconfig.json +2 -2
- package/Binaries/Native/Windows/ARM64/Utils.dll +0 -0
- package/Binaries/Native/Windows/ARM64/_HypertubeNativeErrorLogger_2026-05-06.txt +124 -0
- package/Binaries/Native/Windows/ARM64/version.txt +0 -0
- package/Binaries/Native/Windows/X64/Configs.dll +0 -0
- package/Binaries/Native/Windows/X64/HypertubeActivationService.dll +0 -0
- package/Binaries/Native/Windows/X64/HypertubeClrRuntimeNative.dll +0 -0
- package/Binaries/Native/Windows/X64/HypertubeCppRuntimeNative.dll +0 -0
- package/Binaries/Native/Windows/X64/HypertubeGoRuntimeNative.dll +0 -0
- package/Binaries/Native/Windows/X64/HypertubeJvmRuntimeNative.dll +0 -0
- package/Binaries/Native/Windows/X64/HypertubeNetcoreRuntimeNative.dll +0 -0
- package/Binaries/Native/Windows/X64/HypertubeNodejs2218RuntimeNative.dll +0 -0
- package/Binaries/Native/Windows/X64/HypertubeNodejsRuntimeNative.dll +0 -0
- package/Binaries/Native/Windows/X64/HypertubePhp848RuntimeNative.dll +0 -0
- package/Binaries/Native/Windows/X64/HypertubePhpRuntimeNative.dll +0 -0
- package/Binaries/Native/Windows/X64/HypertubePythonRuntimeNative.dll +0 -0
- package/Binaries/Native/Windows/X64/HypertubeRubyRuntimeNative.dll +0 -0
- package/Binaries/Native/Windows/X64/HypertubeTcpClient.dll +0 -0
- package/Binaries/Native/Windows/X64/HypertubeTcpTlsClient.dll +0 -0
- package/Binaries/Native/Windows/X64/NetVersionLatest.runtimeconfig.json +2 -2
- package/Binaries/Native/Windows/X64/Utils.dll +0 -0
- package/Binaries/Native/Windows/X64/_HypertubeNativeErrorLogger_2026-05-06.txt +124 -0
- package/Binaries/Native/Windows/X64/version.txt +1 -1
- package/Binaries/Netcore/Hypertube.Netcore.Core.dll +0 -0
- package/Binaries/Netcore/Hypertube.Netcore.Plugins.dll +0 -0
- package/Binaries/Netcore/Hypertube.Netcore.Utils.dll +0 -0
- package/Binaries/Php/hypertube/core/delegatecache/DelegatesCache.php +62 -62
- package/Binaries/Php/hypertube/core/handler/AbstractHandler.php +61 -61
- package/Binaries/Php/hypertube/core/handler/AddEventListenerHandler.php +16 -16
- package/Binaries/Php/hypertube/core/handler/ArrayGetItemHandler.php +57 -57
- package/Binaries/Php/hypertube/core/handler/ArrayGetRankHandler.php +50 -50
- package/Binaries/Php/hypertube/core/handler/ArrayGetSizeHandler.php +59 -59
- package/Binaries/Php/hypertube/core/handler/ArrayHandler.php +26 -26
- package/Binaries/Php/hypertube/core/handler/ArrayReferenceHandler.php +16 -16
- package/Binaries/Php/hypertube/core/handler/ArraySetItemHandler.php +87 -87
- package/Binaries/Php/hypertube/core/handler/AsDtoHandler.php +18 -18
- package/Binaries/Php/hypertube/core/handler/AsKwargsHandler.php +19 -19
- package/Binaries/Php/hypertube/core/handler/AsOutHandler.php +19 -19
- package/Binaries/Php/hypertube/core/handler/AsRefHandler.php +20 -20
- package/Binaries/Php/hypertube/core/handler/CastHandler.php +93 -93
- package/Binaries/Php/hypertube/core/handler/ContextMetadataHandler.php +20 -0
- package/Binaries/Php/hypertube/core/handler/ConvertTypeHandler.php +20 -20
- package/Binaries/Php/hypertube/core/handler/CreateInstanceHandler.php +98 -98
- package/Binaries/Php/hypertube/core/handler/CreateNullHandler.php +16 -16
- package/Binaries/Php/hypertube/core/handler/DestructReferenceHandler.php +29 -29
- package/Binaries/Php/hypertube/core/handler/DtoPropertyHandler.php +18 -18
- package/Binaries/Php/hypertube/core/handler/EnableNamespaceHandler.php +36 -36
- package/Binaries/Php/hypertube/core/handler/EnableTypeHandler.php +33 -33
- package/Binaries/Php/hypertube/core/handler/ExceptionHandler.php +16 -16
- package/Binaries/Php/hypertube/core/handler/GenerateLibHandler.php +16 -16
- package/Binaries/Php/hypertube/core/handler/GetAsyncOperationResultHandler.php +16 -16
- package/Binaries/Php/hypertube/core/handler/GetEnumItemHandler.php +16 -16
- package/Binaries/Php/hypertube/core/handler/GetEnumNameHandler.php +16 -16
- package/Binaries/Php/hypertube/core/handler/GetEnumValueHandler.php +16 -16
- package/Binaries/Php/hypertube/core/handler/GetGlobalFieldHandler.php +16 -16
- package/Binaries/Php/hypertube/core/handler/GetInstanceFieldHandler.php +55 -55
- package/Binaries/Php/hypertube/core/handler/GetInstanceMethodAsDelegateHandler.php +52 -52
- package/Binaries/Php/hypertube/core/handler/GetModuleHandler.php +15 -15
- package/Binaries/Php/hypertube/core/handler/GetRefValueHandler.php +16 -16
- package/Binaries/Php/hypertube/core/handler/GetResultTypeHandler.php +16 -16
- package/Binaries/Php/hypertube/core/handler/GetStaticFieldHandler.php +81 -81
- package/Binaries/Php/hypertube/core/handler/GetStaticMethodAsDelegateHandler.php +109 -109
- package/Binaries/Php/hypertube/core/handler/GetTypeHandler.php +146 -146
- package/Binaries/Php/hypertube/core/handler/Handler.php +176 -175
- package/Binaries/Php/hypertube/core/handler/HeartBeatHandler.php +20 -20
- package/Binaries/Php/hypertube/core/handler/InvokeDelegateHandler.php +27 -27
- package/Binaries/Php/hypertube/core/handler/InvokeGenericMethodHandler.php +47 -47
- package/Binaries/Php/hypertube/core/handler/InvokeGenericStaticMethodHandler.php +111 -111
- package/Binaries/Php/hypertube/core/handler/InvokeGlobalFunctionHandler.php +48 -48
- package/Binaries/Php/hypertube/core/handler/InvokeInstanceMethodHandler.php +78 -78
- package/Binaries/Php/hypertube/core/handler/InvokeStaticMethodHandler.php +95 -95
- package/Binaries/Php/hypertube/core/handler/LoadLibraryHandler.php +360 -360
- package/Binaries/Php/hypertube/core/handler/OptimizeHandler.php +16 -16
- package/Binaries/Php/hypertube/core/handler/PassByValueHandler.php +103 -103
- package/Binaries/Php/hypertube/core/handler/PassDelegateHandler.php +58 -58
- package/Binaries/Php/hypertube/core/handler/PluginWrapperHandler.php +15 -15
- package/Binaries/Php/hypertube/core/handler/ProjectResultAsDtoHandler.php +68 -68
- package/Binaries/Php/hypertube/core/handler/RegisterForUpdateHandler.php +65 -65
- package/Binaries/Php/hypertube/core/handler/ResolveInstanceHandler.php +27 -27
- package/Binaries/Php/hypertube/core/handler/RetrieveArrayHandler.php +48 -48
- package/Binaries/Php/hypertube/core/handler/SetInstanceFieldHandler.php +54 -54
- package/Binaries/Php/hypertube/core/handler/SetStaticFieldHandler.php +56 -56
- package/Binaries/Php/hypertube/core/handler/ValueForUpdateHandler.php +20 -20
- package/Binaries/Php/hypertube/core/handler/ValueHandler.php +18 -18
- package/Binaries/Php/hypertube/core/handler/loadLibrary/ClasspathScanner.php +66 -66
- package/Binaries/Php/hypertube/core/http2Client/Http2Client.php +50 -0
- package/Binaries/Php/hypertube/core/interpreter/Interpreter.php +126 -123
- package/Binaries/Php/hypertube/core/namespacescache/NamespacesCache.php +88 -88
- package/Binaries/Php/hypertube/core/protocol/CommandDeserializer.php +337 -337
- package/Binaries/Php/hypertube/core/protocol/CommandSerializer.php +112 -112
- package/Binaries/Php/hypertube/core/protocol/TypeDeserializer.php +102 -102
- package/Binaries/Php/hypertube/core/protocol/TypeSerializer.php +188 -188
- package/Binaries/Php/hypertube/core/receiver/Receiver.php +45 -45
- package/Binaries/Php/hypertube/core/referencecache/ReferencesCache.php +68 -68
- package/Binaries/Php/hypertube/core/transmitter/Transmitter.php +47 -47
- package/Binaries/Php/hypertube/core/transmitter/TransmitterWrapper.php +181 -181
- package/Binaries/Php/hypertube/core/typescache/TypesCache.php +60 -60
- package/Binaries/Php/hypertube/core/webSocketClient/WebSocketClient.php +626 -620
- package/Binaries/Php/hypertube/utils/ArrayWrapper.php +122 -122
- package/Binaries/Php/hypertube/utils/Command.php +265 -265
- package/Binaries/Php/hypertube/utils/CommandInterface.php +23 -23
- package/Binaries/Php/hypertube/utils/DynamicMethodFactory.php +93 -93
- package/Binaries/Php/hypertube/utils/Enum.php +87 -87
- package/Binaries/Php/hypertube/utils/ExceptionSerializer.php +81 -81
- package/Binaries/Php/hypertube/utils/RuntimeLogger.php +44 -44
- package/Binaries/Php/hypertube/utils/RuntimeName.php +21 -21
- package/Binaries/Php/hypertube/utils/RuntimeNameHandler.php +72 -72
- package/Binaries/Php/hypertube/utils/StringEncodingMode.php +12 -12
- package/Binaries/Php/hypertube/utils/TypesHandler.php +47 -47
- package/Binaries/Php/hypertube/utils/Uri.php +138 -138
- package/Binaries/Php/hypertube/utils/UtilsArray.php +16 -16
- package/Binaries/Php/hypertube/utils/UtilsConst.php +75 -75
- package/Binaries/Php/hypertube/utils/UtilsSimpleType.php +48 -48
- package/Binaries/Php/hypertube/utils/Uuid.php +47 -47
- package/Binaries/Php/hypertube/utils/connectiondata/ConnectionData.php +84 -0
- package/Binaries/Php/hypertube/utils/connectiondata/Http2ConnectionData.php +43 -0
- package/Binaries/Php/hypertube/utils/connectiondata/IConnectionData.php +19 -15
- package/Binaries/Php/hypertube/utils/connectiondata/InMemoryConnectionData.php +25 -35
- package/Binaries/Php/hypertube/utils/connectiondata/TcpConnectionData.php +91 -77
- package/Binaries/Php/hypertube/utils/connectiondata/WsConnectionData.php +43 -43
- package/Binaries/Php/hypertube/utils/error/UnsupportedPayloadItemTypeError.php +19 -19
- package/Binaries/Php/hypertube/utils/exception/BadMethodCallException.php +14 -14
- package/Binaries/Php/hypertube/utils/exception/DelegateNotFoundException.php +14 -14
- package/Binaries/Php/hypertube/utils/exception/ExceptionThrower.php +121 -121
- package/Binaries/Php/hypertube/utils/exception/FieldNotFoundInClassException.php +41 -41
- package/Binaries/Php/hypertube/utils/exception/HypertubeArgumentsMismatchException.php +17 -17
- package/Binaries/Php/hypertube/utils/exception/InvalidUriException.php +14 -14
- package/Binaries/Php/hypertube/utils/exception/SingletonUnserializeException.php +15 -15
- package/Binaries/Php/hypertube/utils/exception/TypeByteNotSupportedException.php +14 -14
- package/Binaries/Php/hypertube/utils/exception/TypeNotSupportedException.php +16 -16
- package/Binaries/Php/hypertube/utils/exception/TypeSerializationNotSupportedException.php +18 -18
- package/Binaries/Php/hypertube/utils/exception/UnsupportedOperationException.php +10 -10
- package/Binaries/Php/hypertube/utils/exception/enum/EnumNameNotFoundException.php +15 -15
- package/Binaries/Php/hypertube/utils/exception/enum/InvalidEnumValueException.php +15 -15
- package/Binaries/Php/hypertube/utils/messagehelper/MessageHelper.php +102 -102
- package/Binaries/Php/hypertube/utils/type/CommandType.php +67 -66
- package/Binaries/Php/hypertube/utils/type/ConnectionType.php +15 -14
- package/Binaries/Php/hypertube/utils/type/ExceptionType.php +45 -45
- package/Binaries/Php/hypertube/utils/type/JType.php +24 -24
- package/Binaries/Php/hypertube/utils/type/SizeType.php +22 -22
- package/Binaries/Python/hypertube/core/handler/ContextMetadataHandler.py +7 -0
- package/Binaries/Python/hypertube/core/handler/Handler.py +2 -0
- package/Binaries/Python/hypertube/core/http2Client/Http2Client.py +332 -0
- package/Binaries/Python/hypertube/core/interpreter/Interpreter.py +4 -1
- package/Binaries/Python/hypertube/core/webSocketClient/WebSocketClient.py +88 -26
- package/Binaries/Python/hypertube/utils/CommandType.py +2 -1
- package/Binaries/Python/hypertube/utils/ConnectionType.py +1 -0
- package/Binaries/Python/hypertube/utils/connectionData/Http2ConnectionData.py +36 -0
- package/Binaries/Python/hypertube/utils/connectionData/IConnectionData.py +38 -0
- package/Binaries/Python/hypertube/utils/connectionData/InMemoryConnectionData.py +4 -12
- package/Binaries/Python/hypertube/utils/connectionData/TcpConnectionData.py +29 -16
- package/Binaries/Python/hypertube/utils/connectionData/WsConnectionData.py +14 -12
- package/Binaries/Python/hypertube/utils/messageHelper/MessageHelper.py +20 -15
- package/Binaries/Ruby/core/handler/context_metadata_handler.rb +11 -0
- package/Binaries/Ruby/core/handler/handler.rb +3 -0
- package/Binaries/Ruby/core/http2_client/http2_client.rb +69 -0
- package/Binaries/Ruby/core/interpreter/interpreter.rb +7 -4
- package/Binaries/Ruby/core/web_socket_client/web_socket_client.rb +43 -26
- package/Binaries/Ruby/utils/command_type.rb +3 -0
- package/Binaries/Ruby/utils/connection_type.rb +1 -0
- package/Binaries/Ruby/utils/http2_connection_data.rb +59 -0
- package/Binaries/Ruby/utils/tcp_connection_data.rb +61 -9
- package/Binaries/Ruby/utils/ws_connection_data.rb +40 -6
- package/Binaries/version.txt +1 -1
- package/package.json +1 -1
- package/prebuilds/prebuilds-darwin-arm64/HypertubeNodejsRuntimeAddon.node +0 -0
- package/prebuilds/prebuilds-darwin-x64/HypertubeNodejsRuntimeAddon.node +0 -0
- package/prebuilds/prebuilds-win32-arm64/HypertubeNodejsRuntimeAddon.node +0 -0
- package/prebuilds/prebuilds-win32-x64/HypertubeNodejsRuntimeAddon.node +0 -0
- package/Binaries/Native/Linux/ARM64/NetVersion31LatestPatch.runtimeconfig.json +0 -10
- package/Binaries/Native/Linux/ARM64/NetVersion60LatestPatch.runtimeconfig.json +0 -10
- package/Binaries/Native/Linux/ARM64/NetVersion70LatestPatch.runtimeconfig.json +0 -10
- package/Binaries/Native/Linux/ARM64/_HypertubeNativeErrorLogger_2026-04-17.txt +0 -2
- package/Binaries/Native/Linux/X64/NetVersion31LatestPatch.runtimeconfig.json +0 -10
- package/Binaries/Native/Linux/X64/NetVersion60LatestPatch.runtimeconfig.json +0 -10
- package/Binaries/Native/Linux/X64/NetVersion70LatestPatch.runtimeconfig.json +0 -10
- package/Binaries/Native/Linux/X64/_HypertubeNativeErrorLogger_2026-04-17.txt +0 -2
- package/Binaries/Native/MacOs/ARM64/NetVersion31LatestPatch.runtimeconfig.json +0 -10
- package/Binaries/Native/MacOs/ARM64/NetVersion60LatestPatch.runtimeconfig.json +0 -10
- package/Binaries/Native/MacOs/ARM64/NetVersion70LatestPatch.runtimeconfig.json +0 -10
- package/Binaries/Native/MacOs/ARM64/_HypertubeNativeErrorLogger_2026-04-17.txt +0 -2
- package/Binaries/Native/MacOs/X64/NetVersion31LatestPatch.runtimeconfig.json +0 -10
- package/Binaries/Native/MacOs/X64/NetVersion60LatestPatch.runtimeconfig.json +0 -10
- package/Binaries/Native/MacOs/X64/NetVersion70LatestPatch.runtimeconfig.json +0 -10
- package/Binaries/Native/MacOs/X64/_HypertubeNativeErrorLogger_2026-04-17.txt +0 -2
- package/Binaries/Native/Windows/ARM64/NetVersion31LatestPatch.runtimeconfig.json +0 -10
- package/Binaries/Native/Windows/ARM64/NetVersion60LatestPatch.runtimeconfig.json +0 -10
- package/Binaries/Native/Windows/ARM64/NetVersion70LatestPatch.runtimeconfig.json +0 -10
- package/Binaries/Native/Windows/ARM64/_HypertubeNativeErrorLogger_2026-04-17.txt +0 -2
- package/Binaries/Native/Windows/X64/NetVersion31LatestPatch.runtimeconfig.json +0 -10
- package/Binaries/Native/Windows/X64/NetVersion60LatestPatch.runtimeconfig.json +0 -10
- package/Binaries/Native/Windows/X64/NetVersion70LatestPatch.runtimeconfig.json +0 -10
- package/Binaries/Native/Windows/X64/_HypertubeNativeErrorLogger_2026-04-17.txt +0 -2
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
|
|
3
|
-
declare(strict_types=1);
|
|
4
|
-
|
|
5
|
-
namespace core\handler;
|
|
6
|
-
|
|
7
|
-
use ReflectionClass;
|
|
8
|
-
use ReflectionException;
|
|
9
|
-
use ReflectionMethod;
|
|
10
|
-
use ReflectionType;
|
|
11
|
-
use utils\CommandInterface;
|
|
12
|
-
|
|
13
|
-
final class GetStaticMethodAsDelegateHandler extends AbstractHandler
|
|
14
|
-
{
|
|
15
|
-
private const REQUIRED_ARGUMENTS_COUNT = 2;
|
|
16
|
-
|
|
17
|
-
public function process(CommandInterface $command): ReflectionMethod
|
|
18
|
-
{
|
|
19
|
-
$this->validate($command, self::REQUIRED_ARGUMENTS_COUNT, self::class);
|
|
20
|
-
|
|
21
|
-
$payload = $command->getPayload();
|
|
22
|
-
$classToLoad = $payload[0];
|
|
23
|
-
$methodToInvoke = (string) $payload[1];
|
|
24
|
-
$argumentsTypes = array_slice($payload, 2);
|
|
25
|
-
|
|
26
|
-
try {
|
|
27
|
-
$reflectionClass = $this->getReflectionClass($classToLoad);
|
|
28
|
-
if (!$reflectionClass->hasMethod($methodToInvoke)) {
|
|
29
|
-
$this->throwMethodNotFoundException($reflectionClass, $methodToInvoke, $argumentsTypes);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
$foundMethod = $reflectionClass->getMethod($methodToInvoke);
|
|
33
|
-
if (!$foundMethod->isStatic()) {
|
|
34
|
-
throw new ReflectionException(sprintf('Method %s is not a static method in the class.', $reflectionClass->getName()));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return $foundMethod;
|
|
38
|
-
|
|
39
|
-
} catch (ReflectionException $e) {
|
|
40
|
-
|
|
41
|
-
if (strpos($e->getMessage(), 'does not exist') !== false) {
|
|
42
|
-
throw new ReflectionException(sprintf(
|
|
43
|
-
'Class: %s does not exist',
|
|
44
|
-
$this->getReflectionClassName($classToLoad)
|
|
45
|
-
));
|
|
46
|
-
}
|
|
47
|
-
throw $e;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
private function throwMethodNotFoundException(
|
|
52
|
-
ReflectionClass $reflectionClass,
|
|
53
|
-
string $methodName,
|
|
54
|
-
array $argumentsTypes
|
|
55
|
-
): void {
|
|
56
|
-
$methods = $reflectionClass->getMethods(ReflectionMethod::IS_STATIC);
|
|
57
|
-
$argumentsTypesStr = implode(', ', array_map('gettype', $argumentsTypes));
|
|
58
|
-
|
|
59
|
-
$message = sprintf(
|
|
60
|
-
'Static method %s with arguments [%s] was not found in class %s}. Available static methods:' . PHP_EOL,
|
|
61
|
-
$methodName,
|
|
62
|
-
$argumentsTypesStr,
|
|
63
|
-
$reflectionClass->getName()
|
|
64
|
-
);
|
|
65
|
-
foreach ($methods as $method) {
|
|
66
|
-
$paramTypes = array_map(function($param) {
|
|
67
|
-
return $this->getParamTypeName($param->getType());
|
|
68
|
-
}, $method->getParameters());
|
|
69
|
-
|
|
70
|
-
$paramTypesStr = implode(', ', $paramTypes);
|
|
71
|
-
$message .= $method->getName() . 'with arguments [ ' . $paramTypesStr . ']' . PHP_EOL;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
throw new ReflectionException($message);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* @param mixed $classToLoad
|
|
79
|
-
*/
|
|
80
|
-
private function getReflectionClass($classToLoad): ReflectionClass
|
|
81
|
-
{
|
|
82
|
-
if ($classToLoad instanceof ReflectionClass) {
|
|
83
|
-
return $classToLoad;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return new ReflectionClass($classToLoad);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* @param mixed $classToLoad
|
|
91
|
-
*/
|
|
92
|
-
private function getReflectionClassName($classToLoad): string
|
|
93
|
-
{
|
|
94
|
-
if ($classToLoad instanceof ReflectionClass) {
|
|
95
|
-
return $classToLoad->getName();
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return (string) $classToLoad;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
private function getParamTypeName(?ReflectionType $paramType): string
|
|
102
|
-
{
|
|
103
|
-
if ($paramType) {
|
|
104
|
-
return $paramType->getName();
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return 'mixed';
|
|
108
|
-
}
|
|
109
|
-
}
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
declare(strict_types=1);
|
|
4
|
+
|
|
5
|
+
namespace core\handler;
|
|
6
|
+
|
|
7
|
+
use ReflectionClass;
|
|
8
|
+
use ReflectionException;
|
|
9
|
+
use ReflectionMethod;
|
|
10
|
+
use ReflectionType;
|
|
11
|
+
use utils\CommandInterface;
|
|
12
|
+
|
|
13
|
+
final class GetStaticMethodAsDelegateHandler extends AbstractHandler
|
|
14
|
+
{
|
|
15
|
+
private const REQUIRED_ARGUMENTS_COUNT = 2;
|
|
16
|
+
|
|
17
|
+
public function process(CommandInterface $command): ReflectionMethod
|
|
18
|
+
{
|
|
19
|
+
$this->validate($command, self::REQUIRED_ARGUMENTS_COUNT, self::class);
|
|
20
|
+
|
|
21
|
+
$payload = $command->getPayload();
|
|
22
|
+
$classToLoad = $payload[0];
|
|
23
|
+
$methodToInvoke = (string) $payload[1];
|
|
24
|
+
$argumentsTypes = array_slice($payload, 2);
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
$reflectionClass = $this->getReflectionClass($classToLoad);
|
|
28
|
+
if (!$reflectionClass->hasMethod($methodToInvoke)) {
|
|
29
|
+
$this->throwMethodNotFoundException($reflectionClass, $methodToInvoke, $argumentsTypes);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
$foundMethod = $reflectionClass->getMethod($methodToInvoke);
|
|
33
|
+
if (!$foundMethod->isStatic()) {
|
|
34
|
+
throw new ReflectionException(sprintf('Method %s is not a static method in the class.', $reflectionClass->getName()));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return $foundMethod;
|
|
38
|
+
|
|
39
|
+
} catch (ReflectionException $e) {
|
|
40
|
+
|
|
41
|
+
if (strpos($e->getMessage(), 'does not exist') !== false) {
|
|
42
|
+
throw new ReflectionException(sprintf(
|
|
43
|
+
'Class: %s does not exist',
|
|
44
|
+
$this->getReflectionClassName($classToLoad)
|
|
45
|
+
));
|
|
46
|
+
}
|
|
47
|
+
throw $e;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
private function throwMethodNotFoundException(
|
|
52
|
+
ReflectionClass $reflectionClass,
|
|
53
|
+
string $methodName,
|
|
54
|
+
array $argumentsTypes
|
|
55
|
+
): void {
|
|
56
|
+
$methods = $reflectionClass->getMethods(ReflectionMethod::IS_STATIC);
|
|
57
|
+
$argumentsTypesStr = implode(', ', array_map('gettype', $argumentsTypes));
|
|
58
|
+
|
|
59
|
+
$message = sprintf(
|
|
60
|
+
'Static method %s with arguments [%s] was not found in class %s}. Available static methods:' . PHP_EOL,
|
|
61
|
+
$methodName,
|
|
62
|
+
$argumentsTypesStr,
|
|
63
|
+
$reflectionClass->getName()
|
|
64
|
+
);
|
|
65
|
+
foreach ($methods as $method) {
|
|
66
|
+
$paramTypes = array_map(function($param) {
|
|
67
|
+
return $this->getParamTypeName($param->getType());
|
|
68
|
+
}, $method->getParameters());
|
|
69
|
+
|
|
70
|
+
$paramTypesStr = implode(', ', $paramTypes);
|
|
71
|
+
$message .= $method->getName() . 'with arguments [ ' . $paramTypesStr . ']' . PHP_EOL;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
throw new ReflectionException($message);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @param mixed $classToLoad
|
|
79
|
+
*/
|
|
80
|
+
private function getReflectionClass($classToLoad): ReflectionClass
|
|
81
|
+
{
|
|
82
|
+
if ($classToLoad instanceof ReflectionClass) {
|
|
83
|
+
return $classToLoad;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return new ReflectionClass($classToLoad);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @param mixed $classToLoad
|
|
91
|
+
*/
|
|
92
|
+
private function getReflectionClassName($classToLoad): string
|
|
93
|
+
{
|
|
94
|
+
if ($classToLoad instanceof ReflectionClass) {
|
|
95
|
+
return $classToLoad->getName();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return (string) $classToLoad;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
private function getParamTypeName(?ReflectionType $paramType): string
|
|
102
|
+
{
|
|
103
|
+
if ($paramType) {
|
|
104
|
+
return $paramType->getName();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return 'mixed';
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
|
|
3
|
-
declare(strict_types=1);
|
|
4
|
-
|
|
5
|
-
namespace core\handler;
|
|
6
|
-
|
|
7
|
-
use core\handler\loadLibrary\ClasspathScanner;
|
|
8
|
-
use core\namespacescache\NamespacesCache;
|
|
9
|
-
use core\typescache\TypesCache;
|
|
10
|
-
use Exception;
|
|
11
|
-
use ReflectionClass;
|
|
12
|
-
use utils\CommandInterface;
|
|
13
|
-
|
|
14
|
-
final class GetTypeHandler extends AbstractHandler
|
|
15
|
-
{
|
|
16
|
-
private const REQUIRED_ARGUMENTS_COUNT = 1;
|
|
17
|
-
private array $primitiveTypeMap;
|
|
18
|
-
|
|
19
|
-
public function __construct()
|
|
20
|
-
{
|
|
21
|
-
$this->primitiveTypeMap = [
|
|
22
|
-
'boolean' => 'bool',
|
|
23
|
-
'bool' => 'bool',
|
|
24
|
-
'integer' => 'int',
|
|
25
|
-
'int' => 'int',
|
|
26
|
-
'double' => 'float',
|
|
27
|
-
'float' => 'float',
|
|
28
|
-
'string' => 'string',
|
|
29
|
-
'array' => 'array',
|
|
30
|
-
'object' => 'object',
|
|
31
|
-
'resource' => 'resource',
|
|
32
|
-
'null' => 'null'
|
|
33
|
-
];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
public function process(CommandInterface $command)
|
|
37
|
-
{
|
|
38
|
-
$this->validate($command, self::REQUIRED_ARGUMENTS_COUNT, self::class);
|
|
39
|
-
|
|
40
|
-
$typeName = $this->getTypeName($command);
|
|
41
|
-
|
|
42
|
-
if (array_key_exists($typeName, $this->primitiveTypeMap)) {
|
|
43
|
-
$typeToReturn = $this->primitiveTypeMap[$typeName];
|
|
44
|
-
} else {
|
|
45
|
-
try {
|
|
46
|
-
if (class_exists($typeName)) {
|
|
47
|
-
$typeToReturn = new ReflectionClass($typeName);
|
|
48
|
-
} else {
|
|
49
|
-
if (class_exists($typeName)) {
|
|
50
|
-
$typeToReturn = new ReflectionClass($typeName);
|
|
51
|
-
} else {
|
|
52
|
-
throw new Exception('Class not found: ' . $typeName);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
} catch (Exception $ex) {
|
|
56
|
-
$loadedLibraries = LoadLibraryHandler::getLoadedLibraries();
|
|
57
|
-
$loadedClasses = [];
|
|
58
|
-
|
|
59
|
-
foreach ($loadedLibraries as $library) {
|
|
60
|
-
if (substr($library, -4) === '.php' || substr($library, -5) === '.phar') {
|
|
61
|
-
$scanner = new ClasspathScanner();
|
|
62
|
-
$loadedClasses = array_merge(
|
|
63
|
-
$loadedClasses,
|
|
64
|
-
$scanner->getClassesFromFile($library)
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
$availableClasses = implode(PHP_EOL, $loadedClasses) .
|
|
70
|
-
implode(PHP_EOL, get_declared_classes());
|
|
71
|
-
|
|
72
|
-
$includePath = get_include_path();
|
|
73
|
-
|
|
74
|
-
throw new Exception(sprintf(
|
|
75
|
-
'Type: %s not found in include path' . PHP_EOL
|
|
76
|
-
. 'Load all libraries at the beginning of your application' . PHP_EOL
|
|
77
|
-
. 'Exception: %s' . PHP_EOL
|
|
78
|
-
. 'PHP include path: %s' . PHP_EOL
|
|
79
|
-
. 'Available classes loaded by user: %s' . PHP_EOL,
|
|
80
|
-
$typeName,
|
|
81
|
-
$ex->getMessage(),
|
|
82
|
-
$includePath,
|
|
83
|
-
$availableClasses
|
|
84
|
-
));
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if ($command->getPayloadSize() > 1) {
|
|
89
|
-
$parentClass = $command->getPayload()[1];
|
|
90
|
-
if ($typeToReturn instanceof ReflectionClass && $parentClass instanceof ReflectionClass) {
|
|
91
|
-
if (!$typeToReturn->isSubclassOf($parentClass->getName())) {
|
|
92
|
-
throw new Exception(sprintf(
|
|
93
|
-
'Class %s is not a subclass of %s',
|
|
94
|
-
$typeToReturn->getName(),
|
|
95
|
-
$parentClass->getName()
|
|
96
|
-
));
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
$namespaceCache = NamespacesCache::getInstance();
|
|
102
|
-
$typeCache = TypesCache::getInstance();
|
|
103
|
-
|
|
104
|
-
$typeName = $typeToReturn instanceof ReflectionClass ? $typeToReturn->getName() : (string) $typeToReturn;
|
|
105
|
-
|
|
106
|
-
$isAllowed = ($namespaceCache->isNamespaceCacheEmpty() && $typeCache->isTypeCacheEmpty())
|
|
107
|
-
|| ($typeToReturn instanceof ReflectionClass && $namespaceCache->isTypeAllowed($typeToReturn))
|
|
108
|
-
|| $typeCache->isTypeAllowed($typeName);
|
|
109
|
-
|
|
110
|
-
if (!$isAllowed) {
|
|
111
|
-
$allowedNamespaces = implode(', ', $namespaceCache->getCachedNamespaces());
|
|
112
|
-
$allowedTypes = implode(', ', $typeCache->getTypeCache());
|
|
113
|
-
|
|
114
|
-
$typeName = $typeToReturn instanceof ReflectionClass
|
|
115
|
-
? $typeToReturn->getName()
|
|
116
|
-
: (string) $typeToReturn;
|
|
117
|
-
|
|
118
|
-
throw new Exception(sprintf(
|
|
119
|
-
'Type %s not allowed. Allowed namespaces: %s. Allowed types: %s',
|
|
120
|
-
$typeName,
|
|
121
|
-
$allowedNamespaces,
|
|
122
|
-
$allowedTypes
|
|
123
|
-
));
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return $typeToReturn;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
private function getTypeName(CommandInterface $command): string
|
|
130
|
-
{
|
|
131
|
-
$payload = $command->getPayload()[0];
|
|
132
|
-
if (is_string($payload)) {
|
|
133
|
-
return $payload;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if ($payload instanceof ReflectionClass) {
|
|
137
|
-
return $payload->getName();
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if (is_object($payload)) {
|
|
141
|
-
return get_class($payload);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return gettype($payload);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
declare(strict_types=1);
|
|
4
|
+
|
|
5
|
+
namespace core\handler;
|
|
6
|
+
|
|
7
|
+
use core\handler\loadLibrary\ClasspathScanner;
|
|
8
|
+
use core\namespacescache\NamespacesCache;
|
|
9
|
+
use core\typescache\TypesCache;
|
|
10
|
+
use Exception;
|
|
11
|
+
use ReflectionClass;
|
|
12
|
+
use utils\CommandInterface;
|
|
13
|
+
|
|
14
|
+
final class GetTypeHandler extends AbstractHandler
|
|
15
|
+
{
|
|
16
|
+
private const REQUIRED_ARGUMENTS_COUNT = 1;
|
|
17
|
+
private array $primitiveTypeMap;
|
|
18
|
+
|
|
19
|
+
public function __construct()
|
|
20
|
+
{
|
|
21
|
+
$this->primitiveTypeMap = [
|
|
22
|
+
'boolean' => 'bool',
|
|
23
|
+
'bool' => 'bool',
|
|
24
|
+
'integer' => 'int',
|
|
25
|
+
'int' => 'int',
|
|
26
|
+
'double' => 'float',
|
|
27
|
+
'float' => 'float',
|
|
28
|
+
'string' => 'string',
|
|
29
|
+
'array' => 'array',
|
|
30
|
+
'object' => 'object',
|
|
31
|
+
'resource' => 'resource',
|
|
32
|
+
'null' => 'null'
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public function process(CommandInterface $command)
|
|
37
|
+
{
|
|
38
|
+
$this->validate($command, self::REQUIRED_ARGUMENTS_COUNT, self::class);
|
|
39
|
+
|
|
40
|
+
$typeName = $this->getTypeName($command);
|
|
41
|
+
|
|
42
|
+
if (array_key_exists($typeName, $this->primitiveTypeMap)) {
|
|
43
|
+
$typeToReturn = $this->primitiveTypeMap[$typeName];
|
|
44
|
+
} else {
|
|
45
|
+
try {
|
|
46
|
+
if (class_exists($typeName)) {
|
|
47
|
+
$typeToReturn = new ReflectionClass($typeName);
|
|
48
|
+
} else {
|
|
49
|
+
if (class_exists($typeName)) {
|
|
50
|
+
$typeToReturn = new ReflectionClass($typeName);
|
|
51
|
+
} else {
|
|
52
|
+
throw new Exception('Class not found: ' . $typeName);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
} catch (Exception $ex) {
|
|
56
|
+
$loadedLibraries = LoadLibraryHandler::getLoadedLibraries();
|
|
57
|
+
$loadedClasses = [];
|
|
58
|
+
|
|
59
|
+
foreach ($loadedLibraries as $library) {
|
|
60
|
+
if (substr($library, -4) === '.php' || substr($library, -5) === '.phar') {
|
|
61
|
+
$scanner = new ClasspathScanner();
|
|
62
|
+
$loadedClasses = array_merge(
|
|
63
|
+
$loadedClasses,
|
|
64
|
+
$scanner->getClassesFromFile($library)
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
$availableClasses = implode(PHP_EOL, $loadedClasses) .
|
|
70
|
+
implode(PHP_EOL, get_declared_classes());
|
|
71
|
+
|
|
72
|
+
$includePath = get_include_path();
|
|
73
|
+
|
|
74
|
+
throw new Exception(sprintf(
|
|
75
|
+
'Type: %s not found in include path' . PHP_EOL
|
|
76
|
+
. 'Load all libraries at the beginning of your application' . PHP_EOL
|
|
77
|
+
. 'Exception: %s' . PHP_EOL
|
|
78
|
+
. 'PHP include path: %s' . PHP_EOL
|
|
79
|
+
. 'Available classes loaded by user: %s' . PHP_EOL,
|
|
80
|
+
$typeName,
|
|
81
|
+
$ex->getMessage(),
|
|
82
|
+
$includePath,
|
|
83
|
+
$availableClasses
|
|
84
|
+
));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if ($command->getPayloadSize() > 1) {
|
|
89
|
+
$parentClass = $command->getPayload()[1];
|
|
90
|
+
if ($typeToReturn instanceof ReflectionClass && $parentClass instanceof ReflectionClass) {
|
|
91
|
+
if (!$typeToReturn->isSubclassOf($parentClass->getName())) {
|
|
92
|
+
throw new Exception(sprintf(
|
|
93
|
+
'Class %s is not a subclass of %s',
|
|
94
|
+
$typeToReturn->getName(),
|
|
95
|
+
$parentClass->getName()
|
|
96
|
+
));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
$namespaceCache = NamespacesCache::getInstance();
|
|
102
|
+
$typeCache = TypesCache::getInstance();
|
|
103
|
+
|
|
104
|
+
$typeName = $typeToReturn instanceof ReflectionClass ? $typeToReturn->getName() : (string) $typeToReturn;
|
|
105
|
+
|
|
106
|
+
$isAllowed = ($namespaceCache->isNamespaceCacheEmpty() && $typeCache->isTypeCacheEmpty())
|
|
107
|
+
|| ($typeToReturn instanceof ReflectionClass && $namespaceCache->isTypeAllowed($typeToReturn))
|
|
108
|
+
|| $typeCache->isTypeAllowed($typeName);
|
|
109
|
+
|
|
110
|
+
if (!$isAllowed) {
|
|
111
|
+
$allowedNamespaces = implode(', ', $namespaceCache->getCachedNamespaces());
|
|
112
|
+
$allowedTypes = implode(', ', $typeCache->getTypeCache());
|
|
113
|
+
|
|
114
|
+
$typeName = $typeToReturn instanceof ReflectionClass
|
|
115
|
+
? $typeToReturn->getName()
|
|
116
|
+
: (string) $typeToReturn;
|
|
117
|
+
|
|
118
|
+
throw new Exception(sprintf(
|
|
119
|
+
'Type %s not allowed. Allowed namespaces: %s. Allowed types: %s',
|
|
120
|
+
$typeName,
|
|
121
|
+
$allowedNamespaces,
|
|
122
|
+
$allowedTypes
|
|
123
|
+
));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return $typeToReturn;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
private function getTypeName(CommandInterface $command): string
|
|
130
|
+
{
|
|
131
|
+
$payload = $command->getPayload()[0];
|
|
132
|
+
if (is_string($payload)) {
|
|
133
|
+
return $payload;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if ($payload instanceof ReflectionClass) {
|
|
137
|
+
return $payload->getName();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (is_object($payload)) {
|
|
141
|
+
return get_class($payload);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return gettype($payload);
|
|
145
|
+
}
|
|
146
|
+
}
|