Permalink
Browse files

removed useless type juggling

  • Loading branch information...
dg committed Mar 21, 2018
1 parent d6d36b9 commit 85fb7aa883aee2e3b9620c2ce77b6d232d4d021a
Showing with 4 additions and 7 deletions.
  1. +3 βˆ’6 src/Framework/Assert.php
  2. +1 βˆ’1 src/Runner/Job.php
@@ -391,10 +391,7 @@ public static function noError(callable $function): void
public static function match(string $pattern, $actual, string $description = null): void
{
self::$counter++;
if (!is_string($pattern)) {
throw new \Exception('Pattern must be a string.');
} elseif (!is_scalar($actual)) {
if (!is_scalar($actual)) {
self::fail(self::describe('%1 should match %2', $description), $actual, $pattern);
} elseif (!self::isMatching($pattern, $actual)) {
@@ -459,8 +456,8 @@ public static function with($obj, \Closure $closure)
*/
public static function isMatching(string $pattern, $actual, bool $strict = false): bool
{
if (!is_string($pattern) || !is_scalar($actual)) {
throw new \Exception('Value and pattern must be strings.');
if (!is_scalar($actual)) {
throw new \Exception('Value must be strings.');
}
$old = ini_set('pcre.backtrack_limit', '10000000');
@@ -169,7 +169,7 @@ public function isRunning(): bool
foreach (explode("\r\n", $headers) as $header) {
$pos = strpos($header, ':');
if ($pos !== false) {
$this->headers[trim(substr($header, 0, $pos))] = (string) trim(substr($header, $pos + 1));
$this->headers[trim(substr($header, 0, $pos))] = trim(substr($header, $pos + 1));
}
}
}

0 comments on commit 85fb7aa

Please sign in to comment.