1 | <?php |
||
9 | class Editor |
||
10 | { |
||
11 | /** @type string The editor command to use. */ |
||
12 | private $_editorCommand; |
||
13 | |||
14 | /** |
||
15 | * Initialize the editor command. |
||
16 | * |
||
17 | * @api |
||
18 | * @param string $editorCommand The editor command to use. |
||
19 | */ |
||
20 | public function __construct($editorCommand) |
||
24 | |||
25 | /** |
||
26 | * Edit the given file using the symfony process builder to build the |
||
27 | * symfony process to execute. |
||
28 | * |
||
29 | * @api |
||
30 | * @param \Symfony\Component\Process\ProcessBuilder $processBuilder The |
||
31 | * process builder. |
||
32 | * @param string $filePath The path to the file to edit. |
||
33 | * @return \Symfony\Component\Process\Process The already-executed process. |
||
34 | */ |
||
35 | public function editFile(ProcessBuilder $processBuilder, $filePath) |
||
42 | |||
43 | /** |
||
44 | * Edit the given data using the symfony process builder to build the |
||
45 | * symfony process to execute. |
||
46 | * |
||
47 | * @api |
||
48 | * @param \Symfony\Component\Process\ProcessBuilder $processBuilder The |
||
49 | * process builder. |
||
50 | * @param string $data The data to edit. |
||
51 | * @return string The edited data (left alone if the editor returns a |
||
52 | * failure). |
||
53 | */ |
||
54 | public function editData(ProcessBuilder $processBuilder, $data) |
||
68 | } |
||
69 |