Refactored async await in discovery (#309) #28
Annotations
12 warnings
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/upload-artifact@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
src/API/Crypto.php#L60
Escaped Mutant for Mutator "CastArray":
--- Original
+++ New
@@ @@
{
try {
// Start with 12 random bytes
- $message = pack('C*', ...(array) unpack('C*', random_bytes(12)));
+ $message = pack('C*', ...unpack('C*', random_bytes(12)));
} catch (Throwable $ex) {
throw new Exceptions\Encrypt('Preparing payload header failed', $ex->getCode(), $ex);
}
|
src/API/Crypto.php#L81
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
$message = $message . str_repeat(chr(0), 16 - strlen($message) % 16);
// Encrypt the payload
$cipherText = openssl_encrypt($message, 'AES-128-CBC', $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $iv);
- if ($cipherText === false) {
+ if ($cipherText === true) {
throw new Exceptions\Encrypt('Payload could not be encrypted');
}
// Compute HMAC-SHA-256
|
src/API/Crypto.php#L99
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
public static function decryptPayload(string $data, string $key, string $iv, string $hmacKey) : string
{
$decodedWithSignature = base64_decode($data, true);
- if ($decodedWithSignature === false) {
+ if ($decodedWithSignature === true) {
throw new Exceptions\Decrypt('Payload could not be decoded');
}
$decoded = substr($decodedWithSignature, 0, -self::SIGNATURE_BYTES_LENGTH);
|
src/API/Crypto.php#L120
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
throw new Exceptions\Decrypt('Payload could not be decrypted. Signatures are different');
}
$result = openssl_decrypt($decoded, 'AES-128-CBC', $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $iv);
- if ($result === false) {
+ if ($result === true) {
throw new Exceptions\Decrypt('Payload could not be decrypted');
}
$decrypted = unpack('C*', $result);
|
src/API/Crypto.php#L126
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
throw new Exceptions\Decrypt('Payload could not be decrypted');
}
$decrypted = unpack('C*', $result);
- if ($decrypted === false) {
+ if ($decrypted === true) {
throw new Exceptions\Decrypt('Payload could not be decrypted');
}
$decrypted = array_values($decrypted);
|
src/API/Crypto.php#L135
Escaped Mutant for Mutator "LessThan":
--- Original
+++ New
@@ @@
$decrypted = array_values($decrypted);
$message = [];
// The valid decrypted data starts at byte offset 16
- for ($i = 16; $i < count($decrypted); $i++) {
+ for ($i = 16; $i <= count($decrypted); $i++) {
// Strip ending
if ($decrypted[$i] === 0) {
break;
|
src/API/Crypto.php#L138
Escaped Mutant for Mutator "Break_":
--- Original
+++ New
@@ @@
for ($i = 16; $i < count($decrypted); $i++) {
// Strip ending
if ($decrypted[$i] === 0) {
- break;
+ continue;
}
$message[] = $decrypted[$i];
}
|
src/Commands/Discover.php#L89
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
private DateTimeInterface|null $executedTime = null;
public function __construct(private readonly Api\TelevisionApiFactory $televisionApiFactory, private readonly Helpers\Device $deviceHelper, private readonly Helpers\DeviceProperty $deviceProperty, private readonly Viera\Logger $logger, private readonly DevicesModels\Entities\Devices\DevicesRepository $devicesRepository, private readonly DevicesModels\Configuration\Connectors\Repository $connectorsConfigurationRepository, private readonly DevicesModels\Configuration\Devices\Repository $devicesConfigurationRepository, private readonly DateTimeFactory\Factory $dateTimeFactory, private readonly Localization\Translator $translator, string|null $name = null)
{
- parent::__construct($name);
+
}
/**
* @throws Console\Exception\InvalidArgumentException
|
src/Commands/Discover.php#L97
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
*/
protected function configure() : void
{
- $this->setName(self::NAME)->setDescription('Viera connector discovery')->setDefinition(new Input\InputDefinition([new Input\InputOption('connector', 'c', Input\InputOption::VALUE_OPTIONAL, 'Connector ID or identifier', true)]));
+
}
/**
* @throws ApplicationExceptions\InvalidState
|
src/Commands/Discover.php#L101
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
*/
protected function configure() : void
{
- $this->setName(self::NAME)->setDescription('Viera connector discovery')->setDefinition(new Input\InputDefinition([new Input\InputOption('connector', 'c', Input\InputOption::VALUE_OPTIONAL, 'Connector ID or identifier', true)]));
+ $this->setName(self::NAME)->setDescription('Viera connector discovery')->setDefinition(new Input\InputDefinition([]));
}
/**
* @throws ApplicationExceptions\InvalidState
|
The following artifacts were uploaded using a version of actions/upload-artifact that is scheduled for deprecation: "Logs - Mutations".
Please update your workflow to use v4 of the artifact actions.
Learn more: https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/
|
This job succeeded
Loading