diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 14da349..4af8e6b 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -13,7 +13,7 @@ jobs: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.3.3 + uses: dependabot/fetch-metadata@v1.5.1 with: github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml index 9a784a1..970633c 100644 --- a/.github/workflows/fix-php-code-style-issues.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -13,7 +13,7 @@ jobs: ref: ${{ github.head_ref }} - name: Fix PHP code style issues - uses: aglipanci/laravel-pint-action@0.1.0 + uses: aglipanci/laravel-pint-action@1.0.0 - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v4 diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 557d263..9d41c0c 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -20,7 +20,7 @@ jobs: coverage: none - name: Install composer dependencies - uses: ramsey/composer-install@v1 + uses: ramsey/composer-install@v2 - name: Run PHPStan run: ./vendor/bin/phpstan --error-format=github diff --git a/composer.json b/composer.json index e4a2668..8f4cb59 100644 --- a/composer.json +++ b/composer.json @@ -16,14 +16,14 @@ } ], "require": { - "php": "^7.4", + "php": "^7.4|^8.0|^8.1|^8.2", "spatie/laravel-package-tools": "^1.9.2", - "illuminate/contracts": "^8.83.20", + "illuminate/contracts": "^8.0|^9.0|^10.0", "guzzlehttp/guzzle": "^7.0.1", "ext-soap": "*" }, "require-dev": { - "nunomaduro/collision": "^5.0", + "nunomaduro/collision": "^6.1", "pestphp/pest": "^1.21", "pestphp/pest-plugin-laravel": "^1.1", "phpstan/extension-installer": "^1.1", diff --git a/src/Requests/SoapRequest.php b/src/Requests/SoapRequest.php index a4ef979..adf6924 100644 --- a/src/Requests/SoapRequest.php +++ b/src/Requests/SoapRequest.php @@ -35,7 +35,7 @@ public function request(string $method, array $requestBody, bool $withXMLAttribu 'SOAP REQUEST SUCCESS:'. "\nSOAP method: ".$method. $this->soapClient->__getLastRequest() - ? "\nSOAP request start***".$this->soapClient->__getLastRequest().'***SOAP request end' + ? "\nSOAP request start***".preg_replace('#.+#', '*****', $this->soapClient->__getLastRequest()).'***SOAP request end' : '' ); } @@ -73,10 +73,10 @@ public function request(string $method, array $requestBody, bool $withXMLAttribu } $message = "SOAP REQUEST FAILED:\nMessage: ".$exception->getMessage(). - "\nSOAP method: ".$method. - ( + "\nSOAP method: ".$method. + ( $this->soapClient->__getLastRequest() - ? "\nSOAP request start***".$this->soapClient->__getLastRequest().'***SOAP request end' + ? "\nSOAP request start***".preg_replace('#.+#', '*****', $this->soapClient->__getLastRequest()).'***SOAP request end' : '' ).( $this->soapClient->__getLastResponse() diff --git a/src/Traits/Soap/SoapImportApis.php b/src/Traits/Soap/SoapImportApis.php index 128ec9f..eec7d7f 100644 --- a/src/Traits/Soap/SoapImportApis.php +++ b/src/Traits/Soap/SoapImportApis.php @@ -62,7 +62,7 @@ public function importVApp(string $resourcePoolId, $entityConfig, $instantiation $extraConfig = []; if (isset($configSpec->extraConfig)) { // sometimes there is only one level of nesting - if (property_exists($configSpec->extraConfig, 'key')) { + if (!is_array($configSpec->extraConfig) && property_exists($configSpec->extraConfig, 'key')) { $extraConfig['key'] = $configSpec->extraConfig->key; $extraConfig['value:string'] = $configSpec->extraConfig->value->_value ?? ''; // but sometimes there are several @@ -115,14 +115,14 @@ public function importVApp(string $resourcePoolId, $entityConfig, $instantiation 'version' => $configSpec->version ?? null, 'uuid' => $configSpec->uuid ?? null, 'guestId' => $configSpec->guestId ?? null, - 'files' => $configSpec->files ? new VirtualMachineFileInfo([ + 'files' => isset($configSpec->files) ? new VirtualMachineFileInfo([ 'vmPathName' => $configSpec->files->vmPathName ?? null, 'snapshotDirectory' => $configSpec->files->snapshotDirectory ?? null, 'suspendDirectory' => $configSpec->files->suspendDirectory ?? null, 'logDirectory' => $configSpec->files->logDirectory ?? null, 'ftMetadataDirectory' => $configSpec->files->ftMetadataDirectory ?? null, ]) : null, - 'tools' => $configSpec->tools ? new ToolsConfigInfo([ + 'tools' => isset($configSpec->tools) ? new ToolsConfigInfo([ 'toolsVersion' => $configSpec->tools->toolsVersion ?? null, 'toolsInstallType' => $configSpec->tools->toolsInstallType ?? null, 'afterPowerOn' => $configSpec->tools->afterPowerOn ?? null, @@ -138,7 +138,7 @@ public function importVApp(string $resourcePoolId, $entityConfig, $instantiation 'lastInstallInfo' => $configSpec->tools->lastInstallInfo ?? null, ]) : null, - 'flags' => $configSpec->flags ? new VirtualMachineFlagInfo([ + 'flags' => isset($configSpec->flags) ? new VirtualMachineFlagInfo([ 'disableAcceleration' => $configSpec->flags->disableAcceleration ?? null, 'enableLogging' => $configSpec->flags->enableLogging ?? null, 'useToe' => $configSpec->flags->useToe ?? null, @@ -176,7 +176,7 @@ public function importVApp(string $resourcePoolId, $entityConfig, $instantiation ] : null, ] : null, 'extraConfig' => \count($extraConfig) > 0 ? $extraConfig : null, - 'bootOptions' => $configSpec->bootOptions ? [ + 'bootOptions' => isset($configSpec->bootOptions) ? [ 'bootDelay' => $configSpec->bootOptions->bootDelay ?? null, 'enterBIOSSetup' => $configSpec->bootOptions->enterBIOSSetup ?? null, 'efiSecureBootEnabled' => $configSpec->bootOptions->efiSecureBootEnabled, @@ -186,7 +186,7 @@ public function importVApp(string $resourcePoolId, $entityConfig, $instantiation 'networkBootProtocol' => $configSpec->bootOptions->networkBootProtocol ?? null, ] : null, 'vAppConfig' => [ - 'product' => $configSpec->vAppConfig->product ? [ + 'product' => isset($configSpec->vAppConfig->product) ? [ 'operation' => $configSpec->vAppConfig->product->operation ?? null, 'info' => $configSpec->vAppConfig->product->info ? [ 'key' => $configSpec->vAppConfig->product->info->key ?? null, @@ -206,7 +206,7 @@ public function importVApp(string $resourcePoolId, $entityConfig, $instantiation ], 'firmware' => $configSpec->firmware ?? null, 'nestedHVEnabled' => $configSpec->nestedHVEnabled ?? null, - 'sgxInfo' => $configSpec->sgxInfo ? [ + 'sgxInfo' => isset($configSpec->sgxInfo) ? [ 'epcSize' => $configSpec->sgxInfo->epcSize ?? null, 'flcMode' => $configSpec->sgxInfo->flcMode ?? null, 'lePubKeyHash' => $configSpec->sgxInfo->lePubKeyHash ?? null, diff --git a/src/Types/VirtualFloppyRemoteDeviceBackingInfo.php b/src/Types/VirtualFloppyRemoteDeviceBackingInfo.php new file mode 100644 index 0000000..098a7cd --- /dev/null +++ b/src/Types/VirtualFloppyRemoteDeviceBackingInfo.php @@ -0,0 +1,8 @@ +