Skip to content

Commit 890a20e

Browse files
committed
Added "editAt" method for "Code" class
1 parent ba6c4e2 commit 890a20e

File tree

1 file changed

+21
-0
lines changed
  • src/Service/StreamFilter/Metadata

1 file changed

+21
-0
lines changed

src/Service/StreamFilter/Metadata/Code.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,27 @@ public function edit(Token $token, string $replacement): void
6969
);
7070
}
7171

72+
/**
73+
* Add an edit to the source code at a specific position.
74+
*
75+
* @param int $startPosition
76+
* @param int $width
77+
* @param string $replacement
78+
*
79+
* @return void
80+
*/
81+
public function editAt(
82+
int $startPosition,
83+
int $width,
84+
string $replacement,
85+
): void {
86+
$this->stringMutator->edit(
87+
$startPosition,
88+
$width,
89+
$replacement,
90+
);
91+
}
92+
7293
/**
7394
* Add a string to the end of the source code.
7495
*

0 commit comments

Comments
 (0)