Skip to content

Commit

Permalink
refactor: Do not allow to pass an alias to Pharaoh (#938)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Mar 19, 2023
1 parent c7ca747 commit 14d647f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Pharaoh/Pharaoh.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ final class Pharaoh
private ?PharInfo $pharInfo = null;
private ?string $path = null;

public function __construct(string $file, ?string $alias = null)
public function __construct(string $file)
{
Assert::readable($file);
Assert::false(
Expand All @@ -83,7 +83,7 @@ public function __construct(string $file, ?string $alias = null)
}

// We have to give every one a different alias, or it pukes.
$alias ??= (Hex::encode(random_bytes(16)).'.phar');
$alias = (Hex::encode(random_bytes(16)).'.phar');

$tmpFile = sys_get_temp_dir().DIRECTORY_SEPARATOR.$alias;
copy($file, $tmpFile);
Expand Down

0 comments on commit 14d647f

Please sign in to comment.