Skip to content

Commit 31f316a

Browse files
committed
refactor(WithRunable): rename processTapper to tap for clarity
- Renamed the `processTapper` property to `tap` for improved clarity. - Updated the setter method from `setProcessTapper` to `setTap` to reflect the new naming. - Adjusted the usage of the callable in the process execution to match the new property name. Signed-off-by: guanguans <[email protected]>
1 parent b6024f2 commit 31f316a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/Concerns/WithRunable.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
*/
2121
trait WithRunable
2222
{
23-
/** @var null|callable */
24-
protected $processTapper;
23+
/** @var null|callable(Process):void */
24+
protected $tap;
2525

26-
public function setProcessTapper(?callable $processTapper): self
26+
public function setTap(?callable $tap): self
2727
{
28-
$this->processTapper = $processTapper;
28+
$this->tap = $tap;
2929

3030
return $this;
3131
}
@@ -52,8 +52,8 @@ protected function toProcess(): Process
5252
)
5353
: new Process([$this->soarBinary, ...$normalizedOptions]);
5454

55-
if (\is_callable($this->processTapper)) {
56-
($this->processTapper)($process);
55+
if (\is_callable($this->tap)) {
56+
($this->tap)($process);
5757
}
5858

5959
return $process;

tests/Concerns/WithRunableTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protected function shouldApplySudoPassword(): bool
6161
it('can run soar process with tapper', function (): void {
6262
expect(Soar::make())
6363
->withVersion(true)
64-
->setProcessTapper(static function (Process $process): void {
64+
->setTap(static function (Process $process): void {
6565
$process->setTimeout(3);
6666
})
6767
->run(static function (string $type, string $line): void {

0 commit comments

Comments
 (0)