From 039beb2c797c72418ef951205eaafe8153233e23 Mon Sep 17 00:00:00 2001 From: Lisachenko Alexander Date: Sun, 27 Jun 2021 00:40:53 +0300 Subject: [PATCH] Add several new PHP8 opcodes and clean extra typehints from interfaces --- src/ClassExtension/ObjectCastInterface.php | 2 -- src/ClassExtension/ObjectCompareValuesInterface.php | 2 -- src/ClassExtension/ObjectCreateInterface.php | 2 -- src/ClassExtension/ObjectCreateTrait.php | 2 -- src/ClassExtension/ObjectDoOperationInterface.php | 2 -- src/ClassExtension/ObjectGetPropertiesForInterface.php | 2 -- src/ClassExtension/ObjectGetPropertyPointerInterface.php | 2 -- src/ClassExtension/ObjectHasPropertyInterface.php | 2 -- src/ClassExtension/ObjectReadPropertyInterface.php | 2 -- src/ClassExtension/ObjectUnsetPropertyInterface.php | 2 -- src/ClassExtension/ObjectWritePropertyInterface.php | 2 -- src/System/OpCode.php | 5 +++++ 12 files changed, 5 insertions(+), 22 deletions(-) diff --git a/src/ClassExtension/ObjectCastInterface.php b/src/ClassExtension/ObjectCastInterface.php index cfb7d56..2f6ef74 100644 --- a/src/ClassExtension/ObjectCastInterface.php +++ b/src/ClassExtension/ObjectCastInterface.php @@ -22,8 +22,6 @@ interface ObjectCastInterface /** * Performs casting of given object to another value * - * @param CastObjectHook $hook Instance of current hook - * * @return mixed Casted value */ public static function __cast(CastObjectHook $hook); diff --git a/src/ClassExtension/ObjectCompareValuesInterface.php b/src/ClassExtension/ObjectCompareValuesInterface.php index 5c2fea1..47f2b50 100644 --- a/src/ClassExtension/ObjectCompareValuesInterface.php +++ b/src/ClassExtension/ObjectCompareValuesInterface.php @@ -22,8 +22,6 @@ interface ObjectCompareValuesInterface /** * Performs comparison of given object with another value * - * @param CompareValuesHook $hook Instance of current hook - * * @return int Result of comparison: 1 is greater, -1 is less, 0 is equal */ public static function __compare(CompareValuesHook $hook): int; diff --git a/src/ClassExtension/ObjectCreateInterface.php b/src/ClassExtension/ObjectCreateInterface.php index 3ef18f2..5947e84 100644 --- a/src/ClassExtension/ObjectCreateInterface.php +++ b/src/ClassExtension/ObjectCreateInterface.php @@ -23,8 +23,6 @@ interface ObjectCreateInterface /** * Performs low-level initialization of object during new instances creation * - * @param CreateObjectHook $hook Hook instance that provides proceed() and setClassType() method - * * @return CData Pointer to the zend_object instance */ public static function __init(CreateObjectHook $hook): CData; diff --git a/src/ClassExtension/ObjectCreateTrait.php b/src/ClassExtension/ObjectCreateTrait.php index 66af21a..108a82a 100644 --- a/src/ClassExtension/ObjectCreateTrait.php +++ b/src/ClassExtension/ObjectCreateTrait.php @@ -23,8 +23,6 @@ trait ObjectCreateTrait /** * Performs low-level initialization of object during new instances creation * - * @param CreateObjectHook $hook Hook instance that provides proceed() and setClassType() method - * * @return CData Pointer to the zend_object instance */ public static function __init(CreateObjectHook $hook): CData diff --git a/src/ClassExtension/ObjectDoOperationInterface.php b/src/ClassExtension/ObjectDoOperationInterface.php index 054137f..622177d 100644 --- a/src/ClassExtension/ObjectDoOperationInterface.php +++ b/src/ClassExtension/ObjectDoOperationInterface.php @@ -22,8 +22,6 @@ interface ObjectDoOperationInterface /** * Performs an operation on given object * - * @param DoOperationHook $hook Instance of current hook - * * @return mixed Result of operation value */ public static function __doOperation(DoOperationHook $hook); diff --git a/src/ClassExtension/ObjectGetPropertiesForInterface.php b/src/ClassExtension/ObjectGetPropertiesForInterface.php index 954b8f6..3b72766 100644 --- a/src/ClassExtension/ObjectGetPropertiesForInterface.php +++ b/src/ClassExtension/ObjectGetPropertiesForInterface.php @@ -22,8 +22,6 @@ interface ObjectGetPropertiesForInterface /** * Returns a hash-map (array) representation of object (for casting to array, json encoding, var dumping) * - * @param GetPropertiesForHook $hook Instance of current hook - * * @return array Key-value pair of fields */ public static function __getFields(GetPropertiesForHook $hook): array; diff --git a/src/ClassExtension/ObjectGetPropertyPointerInterface.php b/src/ClassExtension/ObjectGetPropertyPointerInterface.php index d7c96bf..5d7f6a4 100644 --- a/src/ClassExtension/ObjectGetPropertyPointerInterface.php +++ b/src/ClassExtension/ObjectGetPropertyPointerInterface.php @@ -22,8 +22,6 @@ interface ObjectGetPropertyPointerInterface /** * Returns a pointer to an object's field * - * @param GetPropertyPointerHook $hook Instance of current hook - * * @return mixed Value to return */ public static function __fieldPointer(GetPropertyPointerHook $hook); diff --git a/src/ClassExtension/ObjectHasPropertyInterface.php b/src/ClassExtension/ObjectHasPropertyInterface.php index 90aedb3..c364728 100644 --- a/src/ClassExtension/ObjectHasPropertyInterface.php +++ b/src/ClassExtension/ObjectHasPropertyInterface.php @@ -22,8 +22,6 @@ interface ObjectHasPropertyInterface /** * Performs checking of object's field * - * @param HasPropertyHook $hook Instance of current hook - * * @return int Value to return */ public static function __fieldIsset(HasPropertyHook $hook); diff --git a/src/ClassExtension/ObjectReadPropertyInterface.php b/src/ClassExtension/ObjectReadPropertyInterface.php index 7abe29a..671700e 100644 --- a/src/ClassExtension/ObjectReadPropertyInterface.php +++ b/src/ClassExtension/ObjectReadPropertyInterface.php @@ -22,8 +22,6 @@ interface ObjectReadPropertyInterface /** * Performs reading of object's field * - * @param ReadPropertyHook $hook Instance of current hook - * * @return mixed Value to return */ public static function __fieldRead(ReadPropertyHook $hook); diff --git a/src/ClassExtension/ObjectUnsetPropertyInterface.php b/src/ClassExtension/ObjectUnsetPropertyInterface.php index df30e54..c3a251b 100644 --- a/src/ClassExtension/ObjectUnsetPropertyInterface.php +++ b/src/ClassExtension/ObjectUnsetPropertyInterface.php @@ -21,8 +21,6 @@ interface ObjectUnsetPropertyInterface { /** * Performs reading of object's field - * - * @param UnsetPropertyHook $hook Instance of current hook */ public static function __fieldUnset(UnsetPropertyHook $hook): void; } diff --git a/src/ClassExtension/ObjectWritePropertyInterface.php b/src/ClassExtension/ObjectWritePropertyInterface.php index 750376c..9d97d1e 100644 --- a/src/ClassExtension/ObjectWritePropertyInterface.php +++ b/src/ClassExtension/ObjectWritePropertyInterface.php @@ -22,8 +22,6 @@ interface ObjectWritePropertyInterface /** * Performs writing of value to object's field * - * @param WritePropertyHook $hook Instance of current hook - * * @return mixed New value to write, return given $value if you don't want to adjust it */ public static function __fieldWrite(WritePropertyHook $hook); diff --git a/src/System/OpCode.php b/src/System/OpCode.php index 811e694..b0b9965 100644 --- a/src/System/OpCode.php +++ b/src/System/OpCode.php @@ -217,6 +217,11 @@ final class OpCode public const GET_CALLED_CLASS = 192; public const GET_TYPE = 193; public const ARRAY_KEY_EXIST = 194; + public const MATCH = 195; + public const CASE_STRICT = 196; + public const MATCH_ERROR = 197; + public const JMP_NULL = 198; + public const CHECK_UNDEF_ARGS = 199; /** * Reversed class constants, containing names by number