100% type coverage for psalm
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Jens True 2023-07-28 12:12:47 +00:00
parent 14b2155595
commit 1d898e350b
6 changed files with 25 additions and 17 deletions

12
backup

@ -8,8 +8,12 @@ use Composer\InstalledVersions;
$package = \Composer\InstalledVersions::getRootPackage();
$application = new Application('backup', $package['version']);
try {
$application->add(new App\CommandBackup());
$application->add(new App\CommandShow());
$application->add(new App\CommandBackup());
$application->add(new App\CommandShow());
$application->run();
$application->run();
} catch(Exception $e)
{
echo("Critical error: ". $e->getMessage());
}

12
composer.lock generated

@ -3290,16 +3290,16 @@
},
{
"name": "phpunit/php-code-coverage",
"version": "10.1.2",
"version": "10.1.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "db1497ec8dd382e82c962f7abbe0320e4882ee4e"
"reference": "be1fe461fdc917de2a29a452ccf2657d325b443d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/db1497ec8dd382e82c962f7abbe0320e4882ee4e",
"reference": "db1497ec8dd382e82c962f7abbe0320e4882ee4e",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/be1fe461fdc917de2a29a452ccf2657d325b443d",
"reference": "be1fe461fdc917de2a29a452ccf2657d325b443d",
"shasum": ""
},
"require": {
@ -3356,7 +3356,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.2"
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.3"
},
"funding": [
{
@ -3364,7 +3364,7 @@
"type": "github"
}
],
"time": "2023-05-22T09:04:27+00:00"
"time": "2023-07-26T13:45:28+00:00"
},
{
"name": "phpunit/php-file-iterator",

@ -7,12 +7,16 @@
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
findUnusedBaselineEntry="true"
findUnusedCode="true"
strictBinaryOperands="true"
checkForThrowsInGlobalScope="true"
ignoreInternalFunctionFalseReturn="false"
ignoreInternalFunctionNullReturn ="false"
findUnusedVariablesAndParams="true"
findUnusedPsalmSuppress="true"
restrictReturnTypes="true"
>
<projectFiles>
<directory name="src/" />
<file name="backup" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>

@ -81,7 +81,7 @@ class App
*/
public function getConfig(string $key): mixed
{
/** @var mixed */
/** @var string|array<string, string> */
$ret = $this->config->get($key);
$this->logger->debug("Fetching configuration key", [$key, $ret]);
return $ret;

@ -14,7 +14,7 @@ use Exception;
*
* Installation of rclone is required.
* Configuration of the mounts must be done before use.
* Tested using rclone v1.53.3-DEV
* Tested using rclone v1.62.2
*/
class Rclone
{
@ -97,7 +97,7 @@ class Rclone
$options[] = $dest;
foreach ($additionalOptions as $key => $value) {
$options[] = '--' . $key;
$options[] = '--' . (string)$key;
$options[] = $value;
}

@ -48,7 +48,7 @@ final class RcloneTest extends TestCase
$this->expectException(\Exception::class);
$this->expectExceptionMessage("ERROR");
$size = $rclone->getSize('temp/bogus-source');
$rclone->getSize('temp/bogus-source');
$this->fail('Exception was not thrown');
}