PHPStan fixes
parent
fbba175874
commit
589abb06a3
|
@ -17,9 +17,15 @@ parameters:
|
|||
# variable defined in eval
|
||||
- '~^Undefined variable: \$res$~'
|
||||
|
||||
# erroneous detection of missing const, see https://github.com/phpstan/phpstan/issues/2960
|
||||
- '~^Access to undefined constant ZipArchive::OPSYS_UNIX.$~'
|
||||
|
||||
# we don't have different constructors for parent/child
|
||||
- '~^Unsafe usage of new static\(\)\.$~'
|
||||
|
||||
# BC with older PHPUnit
|
||||
- '~^Call to an undefined static method PHPUnit\\Framework\\TestCase::setExpectedException\(\)\.$~'
|
||||
|
||||
# hhvm should have support for $this in closures
|
||||
-
|
||||
count: 1
|
||||
|
|
|
@ -68,7 +68,7 @@ abstract class VcsDownloader implements DownloaderInterface, ChangeReportInterfa
|
|||
return $this->doDownload($package, $path, $url, $prevPackage);
|
||||
} catch (\Exception $e) {
|
||||
// rethrow phpunit exceptions to avoid hard to debug bug failures
|
||||
if ($e instanceof \PHPUnit_Framework_Exception) {
|
||||
if ($e instanceof \PHPUnit\Framework\Exception) {
|
||||
throw $e;
|
||||
}
|
||||
if ($this->io->isDebug()) {
|
||||
|
@ -126,7 +126,7 @@ abstract class VcsDownloader implements DownloaderInterface, ChangeReportInterfa
|
|||
break;
|
||||
} catch (\Exception $e) {
|
||||
// rethrow phpunit exceptions to avoid hard to debug bug failures
|
||||
if ($e instanceof \PHPUnit_Framework_Exception) {
|
||||
if ($e instanceof \PHPUnit\Framework\Exception) {
|
||||
throw $e;
|
||||
}
|
||||
if ($this->io->isDebug()) {
|
||||
|
@ -179,7 +179,7 @@ abstract class VcsDownloader implements DownloaderInterface, ChangeReportInterfa
|
|||
break;
|
||||
} catch (\Exception $exception) {
|
||||
// rethrow phpunit exceptions to avoid hard to debug bug failures
|
||||
if ($exception instanceof \PHPUnit_Framework_Exception) {
|
||||
if ($exception instanceof \PHPUnit\Framework\Exception) {
|
||||
throw $exception;
|
||||
}
|
||||
if ($this->io->isDebug()) {
|
||||
|
|
|
@ -24,7 +24,7 @@ class HtmlOutputFormatterTest extends TestCase
|
|||
'warning' => new OutputFormatterStyle('black', 'yellow'),
|
||||
));
|
||||
|
||||
return $this->assertEquals(
|
||||
$this->assertEquals(
|
||||
'text <span style="color:green;">green</span> <span style="color:yellow;">yellow</span> <span style="color:black;background-color:yellow;">black w/ yello bg</span>',
|
||||
$formatter->format('text <info>green</info> <comment>yellow</comment> <warning>black w/ yello bg</warning>')
|
||||
);
|
||||
|
|
|
@ -53,7 +53,7 @@ class PackageDependencyParserTest extends TestCase
|
|||
{
|
||||
$data = json_decode(file_get_contents(__DIR__.'/Fixtures/DependencyParserTestData.json'), true);
|
||||
if (0 !== json_last_error()) {
|
||||
throw new \PHPUnit_Framework_Exception('Invalid json file.');
|
||||
throw new \PHPUnit\Framework\Exception('Invalid json file.');
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
|
Loading…
Reference in New Issue