Skip to content

Commit 028617b

Browse files
derrabusnicolas-grekas
authored andcommitted
Fix inconsistent return points.
1 parent d49b6a7 commit 028617b

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

ClockMock.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public static function withClockMock($enable = null)
2525
}
2626

2727
self::$now = is_numeric($enable) ? (float) $enable : ($enable ? microtime(true) : null);
28+
29+
return null;
2830
}
2931

3032
public static function time()
@@ -54,6 +56,8 @@ public static function usleep($us)
5456
}
5557

5658
self::$now += $us / 1000000;
59+
60+
return null;
5761
}
5862

5963
public static function microtime($asFloat = false)

DeprecationErrorHandler.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ public static function register($mode = 0)
180180
++$ref;
181181
}
182182
++$deprecations[$group.'Count'];
183+
184+
return null;
183185
};
184186
$oldErrorHandler = set_error_handler($deprecationHandler);
185187

@@ -291,6 +293,8 @@ public static function collectDeprecations($outputFile)
291293
return \call_user_func(DeprecationErrorHandler::getPhpUnitErrorHandler(), $type, $msg, $file, $line, $context);
292294
}
293295
$deprecations[] = array(error_reporting(), $msg, $file);
296+
297+
return null;
294298
});
295299

296300
register_shutdown_function(function () use ($outputFile, &$deprecations) {

Legacy/CoverageListenerTrait.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,7 @@ private function findSutFqcn($test)
9595
$sutFqcn = str_replace('\\Tests\\', '\\', $class);
9696
$sutFqcn = preg_replace('{Test$}', '', $sutFqcn);
9797

98-
if (!class_exists($sutFqcn)) {
99-
return;
100-
}
101-
102-
return $sutFqcn;
98+
return class_exists($sutFqcn) ? $sutFqcn : null;
10399
}
104100

105101
public function __destruct()

Legacy/SymfonyTestsListenerTrait.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ public function handleError($type, $msg, $file, $line, $context = array())
357357
$msg = 'Unsilenced deprecation: '.$msg;
358358
}
359359
$this->gatheredDeprecations[] = $msg;
360+
361+
return null;
360362
}
361363

362364
/**

bin/simple-phpunit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ $argv = isset($_SERVER['argv']) ? $_SERVER['argv'] : array();
135135
$argc = isset($_SERVER['argc']) ? $_SERVER['argc'] : 0;
136136

137137
if ($PHPUNIT_VERSION < 8.0) {
138-
$argv = array_filter($argv, function ($v) use (&$argc) { if ('--do-not-cache-result' !== $v) return true; --$argc; });
138+
$argv = array_filter($argv, function ($v) use (&$argc) { if ('--do-not-cache-result' !== $v) return true; --$argc; return false; });
139139
} elseif (filter_var(getenv('SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE'), FILTER_VALIDATE_BOOLEAN)) {
140140
$argv[] = '--do-not-cache-result';
141141
++$argc;

0 commit comments

Comments
 (0)