Skip to content

Commit c03beb8

Browse files
committed
API updates for 1.2
1 parent 097cded commit c03beb8

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ Include the `phpv8/v8js-stubs` repository in the **require-dev** section of your
1616

1717
```json
1818
"require-dev": {
19-
"phpv8/v8js-stubs": "~1.1"
19+
"phpv8/v8js-stubs": "~1.2"
2020
}
2121
```

src/V8Js.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ class V8Js
1515
* @param array $variables
1616
* @param array $extensions
1717
* @param bool $report_uncaught_exceptions
18+
* @param string $snapshot_blob
1819
*/
19-
public function __construct($object_name = 'PHP', array $variables = null, array $extensions = null, $report_uncaught_exceptions = true)
20+
public function __construct($object_name = 'PHP', array $variables = null, array $extensions = null, $report_uncaught_exceptions = true, $snapshot_blob = null)
2021
{}
2122

2223
/**
@@ -134,4 +135,17 @@ public static function registerExtension($extension_name, $code, array $dependen
134135
*/
135136
public static function getExtensions()
136137
{}
138+
139+
/**
140+
* Creates a custom V8 heap snapshot with the provided JavaScript source embedded.
141+
* Snapshots are supported by V8 4.3.7 and higher. For older versions of V8 this
142+
* extension doesn't provide this method.
143+
*
144+
* @since 1.2.0
145+
* @param string $embed_source
146+
*
147+
* @return string|false
148+
*/
149+
public static function createSnapshot($embed_source)
150+
{}
137151
}

0 commit comments

Comments
 (0)