From b446a1e27eaefef2ad2920266443fc0ac9e1602c Mon Sep 17 00:00:00 2001 From: Bogdan Padalko Date: Tue, 2 May 2017 21:49:26 +0300 Subject: [PATCH] Improve stubs [skip ci] --- .../src/NamedPropertyHandlerConfiguration.php | 15 +++++++++++++++ stubs/src/PropertyHandlerFlags.php | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/stubs/src/NamedPropertyHandlerConfiguration.php b/stubs/src/NamedPropertyHandlerConfiguration.php index c3af63d..04d7168 100644 --- a/stubs/src/NamedPropertyHandlerConfiguration.php +++ b/stubs/src/NamedPropertyHandlerConfiguration.php @@ -20,10 +20,25 @@ class NamedPropertyHandlerConfiguration { /** * @param callable $getter The callback to invoke when getting a property. + * Callback signature is (NameValue $name, PropertyCallbackInfo $args) + * ReturnValue from $args->GetReturnValue() accepts any value. + * * @param callable $setter The callback to invoke when setting a property. + * Callback signature is (\V8\NameValue $name, \V8\Value $value, PropertyCallbackInfo $args) + * ReturnValue from $args->GetReturnValue() accepts any value + * * @param callable $query The callback to invoke to check if a property is present, and if present, get its attributes. + * Callback signature is (\V8\NameValue $name, PropertyCallbackInfo $args) + * ReturnValue from $args->GetReturnValue() accepts integer only + * * @param callable $deleter The callback to invoke when deleting a property. + * Callback signature is (\V8\NameValue $name, PropertyCallbackInfo $args) + * ReturnValue from $args->GetReturnValue() accepts boolean only + * * @param callable $enumerator The callback to invoke to enumerate all the named properties of an object. + * Callback signature is (PropertyCallbackInfo $args). + * ReturnValue from $args->GetReturnValue() accepts ArrayObject only + * * @param int $flags One of \v8\PropertyHandlerFlags constants */ public function __construct( diff --git a/stubs/src/PropertyHandlerFlags.php b/stubs/src/PropertyHandlerFlags.php index 058220c..4ab0f83 100644 --- a/stubs/src/PropertyHandlerFlags.php +++ b/stubs/src/PropertyHandlerFlags.php @@ -16,10 +16,28 @@ namespace V8; +/** + * Configuration flags for V8\NamedPropertyHandlerConfiguration or + * V8\IndexedPropertyHandlerConfiguration. + */ class PropertyHandlerFlags { + /** + * None. + */ const kNone = 0; + /** + * See \V8\AccessControl::ALL_CAN_READ (all cross-context reads are allowed). + */ const kAllCanRead = 1; + /** Will not call into interceptor for properties on the receiver or prototype + * chain, i.e., only call into interceptor for properties that do not exist. + * Currently only valid for named interceptors. + */ const kNonMasking = 2; + /** + * Will not call into interceptor for symbol lookup. Only meaningful for + * named interceptors. + */ const kOnlyInterceptStrings = 4; }