Skip to content
Merged
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
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

new PhpCsFixerCodingStandard()->applyTo($config, [
'heredoc_indentation' => false,
'native_constant_invocation' => false,
]);

return $config;
4 changes: 0 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"php": "^8.4",
"ext-bcmath": "*",
"ext-filter": "*",
"amphp/byte-stream": "^2.1",
"nette/php-generator": "4.2.1",
"thesis/package-version": "0.1.2",
"thesis/protobuf": "^0.1.6",
Expand All @@ -32,9 +31,6 @@
"phpunit/phpunit": "^12.4",
"symfony/var-dumper": "^8.0"
},
"conflict": {
"revolt/event-loop": "<0.2.5"
},
"autoload": {
"psr-4": {
"Thesis\\Protoc\\": "src/"
Expand Down
11 changes: 6 additions & 5 deletions src/Io/ReadStreamInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Thesis\Protoc\Io;

use Amp\ByteStream;
use Thesis\Protoc\Exception\InvalidInput;
use Thesis\Protoc\ReadInput;

Expand All @@ -16,10 +15,12 @@
#[\Override]
public function read(): string
{
try {
return ByteStream\buffer(ByteStream\getStdin());
} catch (ByteStream\BufferException $e) {
throw new InvalidInput($e->getMessage(), $e->getCode(), $e);
$contents = stream_get_contents(\STDIN);

if ($contents === false) {
throw new InvalidInput('Failed to read from STDIN');
}

return $contents;
}
}
3 changes: 1 addition & 2 deletions src/Io/WriteStreamOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Thesis\Protoc\Io;

use Amp\ByteStream;
use Thesis\Protoc\WriteOutput;

/**
Expand All @@ -15,6 +14,6 @@
#[\Override]
public function write(string $buffer): void
{
ByteStream\getStdout()->write($buffer);
fwrite(\STDOUT, $buffer);
}
}