Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop:
  use innmind/stream 4
  • Loading branch information
Baptouuuu committed Jan 29, 2023
2 parents e0b4188 + 36530a6 commit 6e5d856
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 4.2.0 - 2023-01-29

### Changed

- Requires `innmind/stream:~4.0`

## 4.1.0 - 2022-12-18

### Added
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"innmind/operating-system": "~3.1",
"innmind/media-type": "~2.0",
"innmind/filesystem": "~5.2|~6.0",
"innmind/stream": "~3.3"
"innmind/stream": "~4.0"
},
"autoload": {
"psr-4": {
Expand Down
18 changes: 13 additions & 5 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
Model\Channel\Close as CloseChannel,
};
use Innmind\OperatingSystem\CurrentProcess;
use Innmind\Stream\Streams;
use Innmind\Stream\{
Capabilities,
Streams,
};
use Innmind\Immutable\{
Either,
Maybe,
Expand All @@ -24,7 +27,7 @@ final class Client
private Maybe $command;
/** @var callable(): Maybe<Connection> */
private $load;
private Streams $streams;
private Capabilities $streams;
/** @var Maybe<CurrentProcess> */
private Maybe $signals;

Expand All @@ -36,7 +39,7 @@ final class Client
private function __construct(
Maybe $command,
callable $load,
Streams $streams,
Capabilities $streams,
Maybe $signals,
) {
$this->command = $command;
Expand All @@ -48,14 +51,19 @@ private function __construct(
/**
* @param callable(): Maybe<Connection> $load
*/
public static function of(callable $load, Streams $streams = null): self
public static function of(callable $load, Capabilities $streams = null): self
{
/** @var Maybe<Command> */
$command = Maybe::nothing();
/** @var Maybe<CurrentProcess> */
$signals = Maybe::nothing();

return new self($command, $load, $streams ?? Streams::of(), $signals);
return new self(
$command,
$load,
$streams ?? Streams::fromAmbientAuthority(),
$signals,
);
}

public function with(Command $command): self
Expand Down
8 changes: 4 additions & 4 deletions src/Transport/Connection/MessageReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use Innmind\TimeContinuum\Earth\ElapsedPeriod;
use Innmind\Filesystem\File\Content;
use Innmind\Stream\{
Streams,
Capabilities,
Bidirectional,
};
use Innmind\Immutable\{
Expand All @@ -41,9 +41,9 @@
*/
final class MessageReader
{
private Streams $streams;
private Capabilities $streams;

private function __construct(Streams $streams)
private function __construct(Capabilities $streams)
{
$this->streams = $streams;
}
Expand All @@ -61,7 +61,7 @@ public function __invoke(Connection $connection): Either
));
}

public static function of(Streams $streams): self
public static function of(Capabilities $streams): self
{
return new self($streams);
}
Expand Down

0 comments on commit 6e5d856

Please sign in to comment.