Skip to content

Commit

Permalink
Merge branch '8.5' into 9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Feb 9, 2020
2 parents 76b926b + 073d302 commit d350e3d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/Util/Printer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class Printer
{
/**
* @var resource
* @var closed-resource|resource
*/
private $stream;

Expand Down Expand Up @@ -74,6 +74,8 @@ public function __construct($out = null)
public function write(string $buffer): void
{
if ($this->stream) {
\assert(\is_resource($this->stream));

\fwrite($this->stream, $buffer);
} else {
if (\PHP_SAPI !== 'cli' && \PHP_SAPI !== 'phpdbg') {
Expand All @@ -87,6 +89,8 @@ public function write(string $buffer): void
public function flush(): void
{
if ($this->stream && $this->isPhpStream) {
\assert(\is_resource($this->stream));

\fclose($this->stream);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Util/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public static function getMissingRequirements(string $className, string $methodN

if (!\version_compare(\PHP_VERSION, $required['PHP']['version'], $operator->asString())) {
$missing[] = \sprintf('PHP %s %s is required.', $operator->asString(), $required['PHP']['version']);
$hint = $hint ?? 'PHP';
$hint = 'PHP';
}
} elseif (!empty($required['PHP_constraint'])) {
$version = new \PharIo\Version\Version(self::sanitizeVersionNumber(\PHP_VERSION));
Expand All @@ -173,7 +173,7 @@ public static function getMissingRequirements(string $className, string $methodN
$required['PHP_constraint']['constraint']->asString()
);

$hint = $hint ?? 'PHP_constraint';
$hint = 'PHP_constraint';
}
}

Expand Down

0 comments on commit d350e3d

Please sign in to comment.