Skip to content

Commit 5f1e1be

Browse files
staabmsebastianbergmann
authored andcommitted
Fix "fsockopen(): Unable to connect to hostname:0" warning
1 parent cf3e1a5 commit 5f1e1be

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/TextUI/Output/Printer/DefaultPrinter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ private function __construct(string $out)
7171
{
7272
$this->isPhpStream = str_starts_with($out, 'php://');
7373

74-
if (!$this->isPhpStream && !Filesystem::createDirectory(dirname($out))) {
75-
throw new DirectoryDoesNotExistException(dirname($out));
76-
}
77-
7874
if (str_starts_with($out, 'socket://')) {
7975
$tmp = explode(':', str_replace('socket://', '', $out));
8076

@@ -93,6 +89,10 @@ private function __construct(string $out)
9389
return;
9490
}
9591

92+
if (!$this->isPhpStream && !Filesystem::createDirectory(dirname($out))) {
93+
throw new DirectoryDoesNotExistException(dirname($out));
94+
}
95+
9696
$this->stream = fopen($out, 'wb');
9797
$this->isOpen = true;
9898
}

0 commit comments

Comments
 (0)