Skip to content

Commit

Permalink
Add several new PHP8 opcodes and clean extra typehints from interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
lisachenko committed Jun 26, 2021
1 parent f433987 commit 039beb2
Show file tree
Hide file tree
Showing 12 changed files with 5 additions and 22 deletions.
2 changes: 0 additions & 2 deletions src/ClassExtension/ObjectCastInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/ClassExtension/ObjectCompareValuesInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions src/ClassExtension/ObjectCreateInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions src/ClassExtension/ObjectCreateTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/ClassExtension/ObjectDoOperationInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/ClassExtension/ObjectGetPropertiesForInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions src/ClassExtension/ObjectGetPropertyPointerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/ClassExtension/ObjectHasPropertyInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/ClassExtension/ObjectReadPropertyInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/ClassExtension/ObjectUnsetPropertyInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 0 additions & 2 deletions src/ClassExtension/ObjectWritePropertyInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions src/System/OpCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 039beb2

Please sign in to comment.