-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathRequestPreparer.php
37 lines (32 loc) · 1.14 KB
/
RequestPreparer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
declare(strict_types=1);
namespace Mougrim\XdebugProxy\RequestPreparer;
use Mougrim\XdebugProxy\Handler\CommandToXdebugParser;
use Mougrim\XdebugProxy\Xml\XmlDocument;
/**
* @author Mougrim <rinat@mougrim.ru>
* You can use request preparer for example for changing path to files (in break points and execution files).
*/
interface RequestPreparer
{
/**
* In this method you can change $xmlRequest, which will be sent to ide.
*
* @param XmlDocument $xmlRequest request from xdebug to ide
* @param string $rawRequest just for logging purposes
*
* @throws Exception
* @throws Error
*/
public function prepareRequestToIde(XmlDocument $xmlRequest, string $rawRequest): void;
/**
* This method should return request based on $request, which will be sent to xdebug.
* Use $commandToXdebugParser to parse the command in request and to rebuild the command.
*
* @param string $request command from ide to xdebug
*
* @throws Exception
* @throws Error
*/
public function prepareRequestToXdebug(string $request, CommandToXdebugParser $commandToXdebugParser): string;
}