Skip to content

Commit

Permalink
prepare new release, simplify code because phpstan/phpstan-src#148 wa…
Browse files Browse the repository at this point in the history
…s merged
  • Loading branch information
frederikbosch committed Apr 1, 2020
1 parent cf5ce41 commit 2294d92
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 15 deletions.
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,42 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.



## [2.6.0] - 2020-04-01

### Added

- Added PsrLogExceptionTransport

### Changed

- Upgraded PHPStan to version 0.12, various fixes

### Fixed

- Fix space showing up in subject words due message folding (#66)


## [2.5.7] - 2020-03-13

### Fixed

- Supports streams for FilesystemQueue.


## [2.5.6] - 2019-12-12

### Fixed

- Fixes address containing quotes on the folded line


## [2.5.5] - 2019-12-12

### Fixed

- Fix header value parsing, should remove line separations


## [2.5.4] - 2019-02-18

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"require-dev": {
"phpunit/phpunit": "^8.0",
"phpstan/phpstan": "^0.12.11",
"phpstan/phpstan": "^0.12.12",
"phpstan/phpstan-phpunit": "^0.12.6",
"friendsofphp/php-cs-fixer": "^2.9",
"predis/predis": "^1.0",
Expand Down
8 changes: 1 addition & 7 deletions src/Protocol/PlainTcpConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,9 @@ public function __construct(string $host, int $port, float $connectionTimeout =
*/
public function upgrade(int $type): void
{
if ($this->resource === null) {
if ($this->resource === null || \stream_socket_enable_crypto($this->resource, true, $type) === false) {
throw new \InvalidArgumentException('Cannot upgrade connection, resource not available');
}

/** @var int|bool $result */
$result = \stream_socket_enable_crypto($this->resource, true, $type);
if ($result === false) {
throw new \InvalidArgumentException('Cannot upgrade connection to requested encryption type');
}
}

public function connect(): void
Expand Down
8 changes: 1 addition & 7 deletions src/Protocol/PlainTcpConnectionListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,9 @@ public function connect(): void
*/
public function upgrade(int $type): void
{
if ($this->resource === null) {
if ($this->resource === null || \stream_socket_enable_crypto($this->resource, true, $type) === false) {
throw new \InvalidArgumentException('Cannot upgrade connection, resource not available');
}

/** @var int|bool $result */
$result = \stream_socket_enable_crypto($this->resource, true, $type);
if ($result === false) {
throw new \InvalidArgumentException('Cannot upgrade connection to requested encryption type');
}
}
};
}
Expand Down

0 comments on commit 2294d92

Please sign in to comment.