diff --git a/src/commands/install/InstallCommandConfig.php b/src/commands/install/InstallCommandConfig.php index ddc1a194..2f6af058 100644 --- a/src/commands/install/InstallCommandConfig.php +++ b/src/commands/install/InstallCommandConfig.php @@ -59,7 +59,7 @@ public function getTargetDirectory(): Directory { } /** - * @throws Cli\CommandOptionsException + * @throws CommandOptionsException * @throws ConfiguredPharException * @throws InstallCommandConfigException * @throws UnsupportedVersionConstraintException @@ -106,7 +106,7 @@ private function getPharsFromPhiveXmlConfig(): array { } /** - * @throws Cli\CommandOptionsException + * @throws CommandOptionsException * @throws InstallCommandConfigException * @throws UnsupportedVersionConstraintException * diff --git a/src/commands/skel/SkelCommand.php b/src/commands/skel/SkelCommand.php index 8159e3c1..2fdd2e1f 100644 --- a/src/commands/skel/SkelCommand.php +++ b/src/commands/skel/SkelCommand.php @@ -31,7 +31,7 @@ class SkelCommand implements Cli\Command { /** @var Output */ private $output; - public function __construct(SkelCommandConfig $config, Cli\Output $output, PhiveVersion $version, ?DateTimeImmutable $now = null) { + public function __construct(SkelCommandConfig $config, Output $output, PhiveVersion $version, ?DateTimeImmutable $now = null) { $this->config = $config; $this->version = $version; diff --git a/src/services/phar/ReleaseSelector.php b/src/services/phar/ReleaseSelector.php index f87c2ef3..fc72d22a 100644 --- a/src/services/phar/ReleaseSelector.php +++ b/src/services/phar/ReleaseSelector.php @@ -57,6 +57,7 @@ public function select( continue; } + /** @var SupportedRelease $release */ if (!$acceptUnsigned && !$release->hasSignatureUrl()) { $this->output->writeWarning( diff --git a/src/shared/config/PhiveXmlConfig.php b/src/shared/config/PhiveXmlConfig.php index 4d47270b..fcceca3e 100644 --- a/src/shared/config/PhiveXmlConfig.php +++ b/src/shared/config/PhiveXmlConfig.php @@ -123,6 +123,7 @@ public function isPharInstalled(RequestedPhar $phar): bool { */ public function getPhars(): array { $phars = []; + /** @var DOMElement $pharNode */ foreach ($this->configFile->query('//phive:phar') as $pharNode) { $phars[] = $this->nodeToConfiguredPhar($pharNode); diff --git a/src/shared/environment/Environment.php b/src/shared/environment/Environment.php index 9c94eb8c..0e4dbe59 100644 --- a/src/shared/environment/Environment.php +++ b/src/shared/environment/Environment.php @@ -152,6 +152,7 @@ private function disableXDebug(): void { ini_set('xdebug.scream', 'off'); ini_set('xdebug.max_nesting_level', '8192'); ini_set('xdebug.show_exception_trace', 'off'); + // since `xdebug_disable` got removed in Xdebug 3 we have to check for its existance if (function_exists('xdebug_disable')) { xdebug_disable(); diff --git a/src/shared/http/RingdownCurlHttpClient.php b/src/shared/http/RingdownCurlHttpClient.php index dc485373..b5d75b5a 100644 --- a/src/shared/http/RingdownCurlHttpClient.php +++ b/src/shared/http/RingdownCurlHttpClient.php @@ -58,6 +58,7 @@ private function execWrapper(string $method, Url $url, ?ETag $etag): HttpRespons try { $response = $this->client->{$method}($url, $etag); + /** @var HttpResponse $response */ if ($response->isSuccess()) { return $response; diff --git a/tests/regression/bootstrap.php b/tests/regression/bootstrap.php index 162245a2..eba5eba3 100644 --- a/tests/regression/bootstrap.php +++ b/tests/regression/bootstrap.php @@ -1,4 +1,5 @@ run(); +(new PharIo\Phive\RegressionTestBootstrap())->run(); diff --git a/tests/unit/CommandLocatorTest.php b/tests/unit/CommandLocatorTest.php index 75eea6b2..6452df7e 100644 --- a/tests/unit/CommandLocatorTest.php +++ b/tests/unit/CommandLocatorTest.php @@ -54,8 +54,8 @@ public function testRequestingAnUnknownCommandThrowsException(): void { $factory = $this->prophesize(Factory::class); $locator = new CommandLocator($factory->reveal()); - $this->expectException(\PharIo\Phive\Cli\CommandLocatorException::class); - $this->expectExceptionCode(\PharIo\Phive\Cli\CommandLocatorException::UnknownCommand); + $this->expectException(Cli\CommandLocatorException::class); + $this->expectExceptionCode(Cli\CommandLocatorException::UnknownCommand); $locator->getCommand('unknown'); } diff --git a/tests/unit/TestStreamWrapper.php b/tests/unit/TestStreamWrapper.php index 04383aee..8ff0759a 100644 --- a/tests/unit/TestStreamWrapper.php +++ b/tests/unit/TestStreamWrapper.php @@ -139,6 +139,7 @@ public function stream_open($path, $mode, $options, &$opened_path): bool { */ public function url_stat($path, $flags) { $translatedPath = $this->_translate($path, static::$basedir); + // Suppress warnings if requested or if the file or directory does not // exist. This is consistent with PHP's plain filesystem stream wrapper. if ($flags & STREAM_URL_STAT_QUIET || !file_exists($translatedPath)) { diff --git a/tests/unit/services/checksum/ChecksumServiceTest.php b/tests/unit/services/checksum/ChecksumServiceTest.php index e97435a3..a87d6cb3 100644 --- a/tests/unit/services/checksum/ChecksumServiceTest.php +++ b/tests/unit/services/checksum/ChecksumServiceTest.php @@ -32,7 +32,7 @@ public function testThrowsExceptionIfExpectedHashClassIsNotSupported(): void { $file = new File(new Filename('foo'), 'bar'); $service = new ChecksumService(); - $this->expectException(\PharIo\Phive\InvalidHashException::class); + $this->expectException(InvalidHashException::class); $service->verify(new UnsupportedHashStub(), $file); } diff --git a/tests/unit/services/phar/PharDownloaderTest.php b/tests/unit/services/phar/PharDownloaderTest.php index a9c22f40..4ce01fcb 100644 --- a/tests/unit/services/phar/PharDownloaderTest.php +++ b/tests/unit/services/phar/PharDownloaderTest.php @@ -105,7 +105,7 @@ public function testThrowsExceptionIfSignatureVerificationFails(): void { $this->getPharRegistryMock() ); - $this->expectException(\PharIo\Phive\VerificationFailedException::class); + $this->expectException(VerificationFailedException::class); $downloader->download($release); } diff --git a/tests/unit/services/signature/gpg/GnupgSignatureVerifierTest.php b/tests/unit/services/signature/gpg/GnupgSignatureVerifierTest.php index 449d71cb..f2d890f5 100644 --- a/tests/unit/services/signature/gpg/GnupgSignatureVerifierTest.php +++ b/tests/unit/services/signature/gpg/GnupgSignatureVerifierTest.php @@ -33,7 +33,7 @@ public function testThrowsVerificationFailedExceptionIfGnuPgThrowsException(): v $this->gnupg->verify('foo', 'bar')->willThrow(new Exception()); $verifier = new GnupgSignatureVerifier($this->gnupg->reveal(), $this->keyservice->reveal()); - $this->expectException(\PharIo\Phive\VerificationFailedException::class); + $this->expectException(VerificationFailedException::class); $verifier->verify('foo', 'bar', []); } diff --git a/tests/unit/shared/hash/sha/Sha1HashTest.php b/tests/unit/shared/hash/sha/Sha1HashTest.php index c1d2ac7f..7a5d1d6a 100644 --- a/tests/unit/shared/hash/sha/Sha1HashTest.php +++ b/tests/unit/shared/hash/sha/Sha1HashTest.php @@ -36,7 +36,7 @@ public static function validHashProvider() { * @dataProvider invalidHashProvider */ public function testThrowsExceptionIfValueIsNotAValidSha1Hash($hashValue): void { - $this->expectException(\PharIo\Phive\InvalidHashException::class); + $this->expectException(InvalidHashException::class); new Sha1Hash($hashValue); } diff --git a/tests/unit/shared/hash/sha/Sha256HashTest.php b/tests/unit/shared/hash/sha/Sha256HashTest.php index c286a01e..a971ce90 100644 --- a/tests/unit/shared/hash/sha/Sha256HashTest.php +++ b/tests/unit/shared/hash/sha/Sha256HashTest.php @@ -36,7 +36,7 @@ public static function validHashProvider() { * @dataProvider invalidHashProvider */ public function testThrowsExceptionIfValueIsNotAValidSha256Hash($hashValue): void { - $this->expectException(\PharIo\Phive\InvalidHashException::class); + $this->expectException(InvalidHashException::class); new Sha256Hash($hashValue); } diff --git a/tests/unit/shared/hash/sha/Sha384HashTest.php b/tests/unit/shared/hash/sha/Sha384HashTest.php index 57fad559..1319bc05 100644 --- a/tests/unit/shared/hash/sha/Sha384HashTest.php +++ b/tests/unit/shared/hash/sha/Sha384HashTest.php @@ -37,7 +37,7 @@ public static function validHashProvider() { * @dataProvider invalidHashProvider */ public function testThrowsExceptionIfValueIsNotAValidSha384Hash($hashValue): void { - $this->expectException(\PharIo\Phive\InvalidHashException::class); + $this->expectException(InvalidHashException::class); new Sha384Hash($hashValue); } diff --git a/tests/unit/shared/hash/sha/Sha512HashTest.php b/tests/unit/shared/hash/sha/Sha512HashTest.php index 41f3d941..f5b8be9e 100644 --- a/tests/unit/shared/hash/sha/Sha512HashTest.php +++ b/tests/unit/shared/hash/sha/Sha512HashTest.php @@ -38,7 +38,7 @@ public static function validHashProvider() { * @dataProvider invalidHashProvider */ public function testThrowsExceptionIfValueIsNotAValidSha512Hash($hashValue): void { - $this->expectException(\PharIo\Phive\InvalidHashException::class); + $this->expectException(InvalidHashException::class); new Sha512Hash($hashValue); } diff --git a/tests/unit/shared/http/CurlConfigTest.php b/tests/unit/shared/http/CurlConfigTest.php index 4e08c479..a73e6239 100644 --- a/tests/unit/shared/http/CurlConfigTest.php +++ b/tests/unit/shared/http/CurlConfigTest.php @@ -90,7 +90,7 @@ public function testAddsLocalSslCertificate(): void { public function testGetLocalSslCertificateThrowsExceptionIfCertificateDoesNotExist(): void { $config = new CurlConfig('foo'); - $this->expectException(\PharIo\Phive\CurlConfigException::class); + $this->expectException(CurlConfigException::class); $config->getLocalSslCertificate('example.com'); } diff --git a/tests/unit/shared/phar/RequestedPharTest.php b/tests/unit/shared/phar/RequestedPharTest.php index 23e57d2d..f8e8fe4d 100644 --- a/tests/unit/shared/phar/RequestedPharTest.php +++ b/tests/unit/shared/phar/RequestedPharTest.php @@ -118,7 +118,7 @@ private function getVersionConstraintMock() { } /** - * @return Filename|PHPUnit_Framework_MockObject_Mockobject + * @return Filename|PHPUnit_Framework_MockObject_MockObject */ private function getFilenameMock() { return $this->createMock(Filename::class);