@@ -16,7 +16,6 @@ them in the list of schemes.
1616
1717``` php
1818$app = new Boson\Application(new Boson\ApplicationCreateInfo(
19- // List of handling "https" protocol
2019 schemes: [ 'test' ],
2120));
2221
@@ -49,14 +48,14 @@ case, `test`), you can start catching the corresponding events of sending
4948requests to this protocol (to this scheme).
5049
5150``` php
52- use Boson\WebView\Event\WebViewRequest ;
51+ use Boson\WebView\Api\Schemes\ Event\SchemeRequestReceived ;
5352
5453$app = new Boson\Application(new Boson\ApplicationCreateInfo(
55- // List of middleware for "https" protocol
54+ // List of intecpted schemes
5655 schemes: [ 'test' ],
5756));
5857
59- $app->on(function (WebViewRequest $e): void {
58+ $app->on(function (SchemeRequestReceived $e): void {
6059 echo sprintf("%s %s\r\n", $e->request->method, $e->request->url);
6160
6261 foreach ($e->request->headers as $header => $value) {
@@ -85,7 +84,7 @@ In that case, if you need to block a request to a specified URL,
8584you can cancel it.
8685
8786``` php
88- $app->on(function (WebViewRequest $e): void {
87+ $app->on(function (SchemeRequestReceived $e): void {
8988 $e->cancel();
9089});
9190```
@@ -94,7 +93,7 @@ In addition to canceling a request, you can also simulate a
9493response from a resource.
9594
9695``` php
97- $app->on(function (WebViewRequest $e): void {
96+ $app->on(function (SchemeRequestReceived $e): void {
9897 $e->response = new Boson\Http\Response(
9998 body: 'Hello World!',
10099 );
@@ -104,7 +103,7 @@ $app->on(function (WebViewRequest $e): void {
104103Or a more complex response example:
105104
106105``` php
107- $app->on(function (WebViewRequest $e): void {
106+ $app->on(function (SchemeRequestReceived $e): void {
108107 $e->response = new Boson\Http\Response(
109108 body: json_encode(['error' => 'Something went wrong']),
110109 headers: ['content-type' => 'application/json'],
@@ -116,7 +115,7 @@ $app->on(function (WebViewRequest $e): void {
116115Or using specific ` JsonResponse ` response instance:
117116
118117``` php
119- $app->on(function (WebViewRequest $e): void {
118+ $app->on(function (SchemeRequestReceived $e): void {
120119 $e->response = new Boson\Http\JsonResponse(
121120 body: ['error' => 'Something went wrong'],
122121 status: 404,
0 commit comments