Skip to content

Commit 3503ef7

Browse files
committed
Revert "minor - fix allergy for type casting"
This reverts commit cd2adad.
1 parent 0220bf7 commit 3503ef7

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/Runner/Parallel/ParallelisationException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class ParallelisationException extends \RuntimeException
2525
{
2626
public static function forUnknownIdentifier(ProcessIdentifier $identifier): self
2727
{
28-
return new self(sprintf('Unknown process identifier: %s.', $identifier->__toString()));
28+
return new self('Unknown process identifier: '.(string) $identifier);
2929
}
3030

3131
/**

src/Runner/Parallel/ProcessFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function getCommandArgs(int $serverPort, ProcessIdentifier $identifier, R
8080
'--port',
8181
(string) $serverPort,
8282
'--identifier',
83-
escapeshellarg($identifier->__toString()),
83+
escapeshellarg((string) $identifier),
8484
];
8585

8686
if ($runnerConfig->isDryRun()) {

src/Runner/Parallel/ProcessPool.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,21 @@ public function __construct(ServerInterface $server, ?callable $onServerClose =
4545

4646
public function getProcess(ProcessIdentifier $identifier): Process
4747
{
48-
if (!isset($this->processes[$identifier->__toString()])) {
48+
if (!isset($this->processes[(string) $identifier])) {
4949
throw ParallelisationException::forUnknownIdentifier($identifier);
5050
}
5151

52-
return $this->processes[$identifier->__toString()];
52+
return $this->processes[(string) $identifier];
5353
}
5454

5555
public function addProcess(ProcessIdentifier $identifier, Process $process): void
5656
{
57-
$this->processes[$identifier->__toString()] = $process;
57+
$this->processes[(string) $identifier] = $process;
5858
}
5959

6060
public function endProcessIfKnown(ProcessIdentifier $identifier): void
6161
{
62-
if (!isset($this->processes[$identifier->__toString()])) {
62+
if (!isset($this->processes[(string) $identifier])) {
6363
return;
6464
}
6565

@@ -77,7 +77,7 @@ private function endProcess(ProcessIdentifier $identifier): void
7777
{
7878
$this->getProcess($identifier)->quit();
7979

80-
unset($this->processes[$identifier->__toString()]);
80+
unset($this->processes[(string) $identifier]);
8181

8282
if (0 === \count($this->processes)) {
8383
$this->server->close();

0 commit comments

Comments
 (0)