Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ProcessManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public static function obscure(string $secret): string
throw new InvalidArgumentException('Cannot obscure an empty secret.');
}

$process = new Process([self::getBin(), 'obscure', $secret]);
$process = new Process([self::getBin(), 'obscure', '--', $secret]);
$process->setTimeout(3);
$process->mustRun();

Expand Down
8 changes: 8 additions & 0 deletions tests/Unit/EdgeCasesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,14 @@ public function format_bytes_edge_cases(): void
$this->assertEquals('1 MiB', StatsParser::formatBytes(1048576));
}

#[Test]
public function obscure_with_hyphen(): void
{
$obscured = \Verseles\Flyclone\ProcessManager::obscure('-my-password');
$this->assertNotEmpty($obscured);
$this->assertStringNotContainsString('-my-password', $obscured);
}

#[Test]
public function deeply_nested_directory_structure(): void
{
Expand Down
Loading