Pint: Formatierung des bisherigen Stands, ohne inhaltliche Aenderung

Die Dateien lagen im Arbeitsbaum formatiert und inhaltlich geaendert
zusammen. Dieser Commit enthaelt nur die Pint-Formatierung des alten
Stands, damit die folgenden Commits nur noch Inhalt zeigen.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kevin 2026-09-23 15:39:17 +00:00
parent bdef77462d
commit 316a9b76d6
33 changed files with 880 additions and 841 deletions

View file

@ -7,6 +7,7 @@ use Acme\Dhl\Exceptions\DhlValidationException;
use Acme\Dhl\Jobs\CreateShipmentJob;
use Acme\Dhl\Models\DhlShipment;
use Acme\Dhl\Support\DhlClient;
use App\Models\Setting;
use App\Services\DhlProductResolver;
use App\Services\DhlShipmentService;
use App\Services\DhlShipmentWeightCalculator;
@ -136,7 +137,7 @@ class ShippingService
]);
return true;
} catch (\Exception $e) {
} catch (Exception $e) {
$this->recordCancellationFailure($shipment, $e);
Log::error('[DHL Package] Shipment cancellation failed', [
@ -165,7 +166,7 @@ class ShippingService
]);
}
private function recordCancellationFailure(DhlShipment $shipment, \Exception $exception): void
private function recordCancellationFailure(DhlShipment $shipment, Exception $exception): void
{
$apiResponseData = $shipment->api_response_data ?? [];
$apiResponseData['cancellation_error'] = [
@ -637,7 +638,7 @@ class ShippingService
$errorMessage .= '• Die 5-10-stellige POSTNUMMER ist etwas anderes (kommt ins separate Feld!)'.PHP_EOL;
$errorMessage .= '• Beispiel: Packstation 145, PLZ 12345, Postnummer 1234567890';
throw new \InvalidArgumentException($errorMessage);
throw new InvalidArgumentException($errorMessage);
}
// Validate postNumber: must be 6-10 digits
@ -646,7 +647,7 @@ class ShippingService
Log::error('Invalid DHL Postnummer - must be 6-10 digits', [
'postNumber' => $postNumber,
]);
throw new \InvalidArgumentException(
throw new InvalidArgumentException(
'DHL Postnummer muss 6-10 Ziffern enthalten. Bitte prüfen Sie die Postnummer.'
);
}
@ -755,7 +756,7 @@ class ShippingService
$settingKey = 'dhl_account_'.strtolower($productCode);
try {
$accountNumber = \App\Models\Setting::getContentBySlug($settingKey);
$accountNumber = Setting::getContentBySlug($settingKey);
if ($accountNumber) {
Log::info('Using DHL account number from database settings', [
'product_code' => $productCode,
@ -764,7 +765,7 @@ class ShippingService
return $accountNumber;
}
} catch (\Exception $e) {
} catch (Exception $e) {
Log::warning('Could not load DHL account number from settings', [
'product_code' => $productCode,
'setting_key' => $settingKey,
@ -906,13 +907,13 @@ class ShippingService
Storage::disk('local')->put($path, base64_decode($labelBase64));
$success = true;
break;
} catch (\Exception $e) {
} catch (Exception $e) {
Log::warning('Storage put failed, retrying', ['attempt' => $attempt, 'error' => $e->getMessage()]);
usleep(1000000); // 1 second in microseconds
}
}
if (! $success) {
throw new \Exception('Failed to save label after 3 attempts');
throw new Exception('Failed to save label after 3 attempts');
}
$shipment->update(['label_path' => $path]);