Skip to content

Commit

Permalink
Run CS Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
theseer committed Mar 21, 2024
1 parent 2ee7543 commit 06ff940
Show file tree
Hide file tree
Showing 18 changed files with 21 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/commands/install/InstallCommandConfig.php
Expand Up @@ -59,7 +59,7 @@ public function getTargetDirectory(): Directory {
}

/**
* @throws Cli\CommandOptionsException
* @throws CommandOptionsException
* @throws ConfiguredPharException
* @throws InstallCommandConfigException
* @throws UnsupportedVersionConstraintException
Expand Down Expand Up @@ -106,7 +106,7 @@ private function getPharsFromPhiveXmlConfig(): array {
}

/**
* @throws Cli\CommandOptionsException
* @throws CommandOptionsException
* @throws InstallCommandConfigException
* @throws UnsupportedVersionConstraintException
*
Expand Down
2 changes: 1 addition & 1 deletion src/commands/skel/SkelCommand.php
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions src/services/phar/ReleaseSelector.php
Expand Up @@ -57,6 +57,7 @@ public function select(

continue;
}

/** @var SupportedRelease $release */
if (!$acceptUnsigned && !$release->hasSignatureUrl()) {
$this->output->writeWarning(
Expand Down
1 change: 1 addition & 0 deletions src/shared/config/PhiveXmlConfig.php
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/shared/environment/Environment.php
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/shared/http/RingdownCurlHttpClient.php
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion tests/regression/bootstrap.php
@@ -1,4 +1,5 @@
<?php declare(strict_types=1);

/*
* This file is part of Phive.
*
Expand All @@ -14,4 +15,4 @@

require __DIR__ . '/RegressionTestCase.php';

(new \PharIo\Phive\RegressionTestBootstrap())->run();
(new PharIo\Phive\RegressionTestBootstrap())->run();
4 changes: 2 additions & 2 deletions tests/unit/CommandLocatorTest.php
Expand Up @@ -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');
}
Expand Down
1 change: 1 addition & 0 deletions tests/unit/TestStreamWrapper.php
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/services/checksum/ChecksumServiceTest.php
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/services/phar/PharDownloaderTest.php
Expand Up @@ -105,7 +105,7 @@ public function testThrowsExceptionIfSignatureVerificationFails(): void {
$this->getPharRegistryMock()
);

$this->expectException(\PharIo\Phive\VerificationFailedException::class);
$this->expectException(VerificationFailedException::class);

$downloader->download($release);
}
Expand Down
Expand Up @@ -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', []);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/shared/hash/sha/Sha1HashTest.php
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/shared/hash/sha/Sha256HashTest.php
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/shared/hash/sha/Sha384HashTest.php
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/shared/hash/sha/Sha512HashTest.php
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/shared/http/CurlConfigTest.php
Expand Up @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/shared/phar/RequestedPharTest.php
Expand Up @@ -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);
Expand Down

0 comments on commit 06ff940

Please sign in to comment.