Skip to content

Commit 85fb7aa

Browse files
committed
removed useless type juggling
1 parent d6d36b9 commit 85fb7aa

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/Framework/Assert.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,7 @@ public static function noError(callable $function): void
391391
public static function match(string $pattern, $actual, string $description = null): void
392392
{
393393
self::$counter++;
394-
if (!is_string($pattern)) {
395-
throw new \Exception('Pattern must be a string.');
396-
397-
} elseif (!is_scalar($actual)) {
394+
if (!is_scalar($actual)) {
398395
self::fail(self::describe('%1 should match %2', $description), $actual, $pattern);
399396

400397
} elseif (!self::isMatching($pattern, $actual)) {
@@ -459,8 +456,8 @@ public static function with($obj, \Closure $closure)
459456
*/
460457
public static function isMatching(string $pattern, $actual, bool $strict = false): bool
461458
{
462-
if (!is_string($pattern) || !is_scalar($actual)) {
463-
throw new \Exception('Value and pattern must be strings.');
459+
if (!is_scalar($actual)) {
460+
throw new \Exception('Value must be strings.');
464461
}
465462

466463
$old = ini_set('pcre.backtrack_limit', '10000000');

src/Runner/Job.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public function isRunning(): bool
169169
foreach (explode("\r\n", $headers) as $header) {
170170
$pos = strpos($header, ':');
171171
if ($pos !== false) {
172-
$this->headers[trim(substr($header, 0, $pos))] = (string) trim(substr($header, $pos + 1));
172+
$this->headers[trim(substr($header, 0, $pos))] = trim(substr($header, $pos + 1));
173173
}
174174
}
175175
}

0 commit comments

Comments
 (0)