From ae73bbaf8448339364ef1d4163dbc292c43f3696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Novotn=C3=BD?= Date: Thu, 12 Dec 2024 14:40:29 +0100 Subject: [PATCH] Normalize return types --- phpstan.neon | 4 ---- src/Model/AdrUnit/AdrUnitFactory.php | 2 -- src/Model/Attribute/AttributeFactory.php | 2 -- src/Model/Carrier/CarrierFactory.php | 2 -- src/Model/Changelog/ChangelogFactory.php | 2 -- src/Model/Country/CountryFactory.php | 2 -- .../ManipulationUnitFactory.php | 2 -- src/Model/Method/MethodFactory.php | 2 -- src/Model/Package/PackageFactory.php | 2 -- src/Model/Service/ServiceFactory.php | 2 -- src/Model/Status/StatusFactory.php | 4 ---- src/Model/Status/Statuses.php | 3 --- .../TransportCost/TransportCostFactory.php | 2 -- src/Service/InfoService.php | 2 -- src/Service/PackageService.php | 10 -------- src/Service/SettingService.php | 24 ------------------- src/Service/TrackService.php | 8 ------- 17 files changed, 75 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index fe260b1..3c8d972 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -19,7 +19,3 @@ parameters: message: '#^Method Inspirum\\Balikobot\\Model\\BasePerCarrierCollection\:\:first\(\) should return \(TValue of Inspirum\\Arrayable\\Arrayable\&Inspirum\\Balikobot\\Model\\WithCarrierId\)\|null but returns Inspirum\\Arrayable\\Arrayable\&Inspirum\\Balikobot\\Model\\WithCarrierId\.$#' count: 1 path: src/Model/BasePerCarrierCollection.php - - - message: '#^PHPDoc tag \@return contains unresolvable type\.$#' - count: 35 - path: src/** diff --git a/src/Model/AdrUnit/AdrUnitFactory.php b/src/Model/AdrUnit/AdrUnitFactory.php index 2dd115e..3bb1c32 100644 --- a/src/Model/AdrUnit/AdrUnitFactory.php +++ b/src/Model/AdrUnit/AdrUnitFactory.php @@ -13,8 +13,6 @@ public function create(string $carrier, array $data): AdrUnit; /** * @param array $data - * - * @return \Inspirum\Balikobot\Model\AdrUnit\AdrUnitCollection&array<\Inspirum\Balikobot\Model\AdrUnit\AdrUnit> */ public function createCollection(string $carrier, array $data): AdrUnitCollection; } diff --git a/src/Model/Attribute/AttributeFactory.php b/src/Model/Attribute/AttributeFactory.php index 30afa52..68bea0f 100644 --- a/src/Model/Attribute/AttributeFactory.php +++ b/src/Model/Attribute/AttributeFactory.php @@ -13,8 +13,6 @@ public function create(array $data): Attribute; /** * @param array $data - * - * @return \Inspirum\Balikobot\Model\Attribute\AttributeCollection&array<\Inspirum\Balikobot\Model\Attribute\Attribute> */ public function createCollection(string $carrier, array $data): AttributeCollection; } diff --git a/src/Model/Carrier/CarrierFactory.php b/src/Model/Carrier/CarrierFactory.php index 76cfc4a..1c81e55 100644 --- a/src/Model/Carrier/CarrierFactory.php +++ b/src/Model/Carrier/CarrierFactory.php @@ -13,8 +13,6 @@ public function create(string $carrier, array $data): Carrier; /** * @param array> $data - * - * @return \Inspirum\Balikobot\Model\Carrier\CarrierCollection&array<\Inspirum\Balikobot\Model\Carrier\Carrier> */ public function createCollection(array $data): CarrierCollection; } diff --git a/src/Model/Changelog/ChangelogFactory.php b/src/Model/Changelog/ChangelogFactory.php index 5964bdc..c0c3ba1 100644 --- a/src/Model/Changelog/ChangelogFactory.php +++ b/src/Model/Changelog/ChangelogFactory.php @@ -16,8 +16,6 @@ public function create(array $data): Changelog; /** * @param array $data * - * @return \Inspirum\Balikobot\Model\Changelog\ChangelogCollection&array<\Inspirum\Balikobot\Model\Changelog\Changelog> - * * @throws \Exception */ public function createCollection(array $data): ChangelogCollection; diff --git a/src/Model/Country/CountryFactory.php b/src/Model/Country/CountryFactory.php index ec43943..4f1380c 100644 --- a/src/Model/Country/CountryFactory.php +++ b/src/Model/Country/CountryFactory.php @@ -13,8 +13,6 @@ public function create(array $data): Country; /** * @param array $data - * - * @return \Inspirum\Balikobot\Model\Country\CountryCollection&array<\Inspirum\Balikobot\Model\Country\Country> */ public function createCollection(array $data): CountryCollection; diff --git a/src/Model/ManipulationUnit/ManipulationUnitFactory.php b/src/Model/ManipulationUnit/ManipulationUnitFactory.php index dbaaab3..06bd2a3 100644 --- a/src/Model/ManipulationUnit/ManipulationUnitFactory.php +++ b/src/Model/ManipulationUnit/ManipulationUnitFactory.php @@ -13,8 +13,6 @@ public function create(array $data): ManipulationUnit; /** * @param array $data - * - * @return \Inspirum\Balikobot\Model\ManipulationUnit\ManipulationUnitCollection&array<\Inspirum\Balikobot\Model\ManipulationUnit\ManipulationUnit> */ public function createCollection(string $carrier, array $data): ManipulationUnitCollection; } diff --git a/src/Model/Method/MethodFactory.php b/src/Model/Method/MethodFactory.php index 6fee80d..cc40a06 100644 --- a/src/Model/Method/MethodFactory.php +++ b/src/Model/Method/MethodFactory.php @@ -13,8 +13,6 @@ public function create(array $data): Method; /** * @param array> $data - * - * @return \Inspirum\Balikobot\Model\Method\MethodCollection&array<\Inspirum\Balikobot\Model\Method\Method> */ public function createCollection(array $data): MethodCollection; } diff --git a/src/Model/Package/PackageFactory.php b/src/Model/Package/PackageFactory.php index ef9a744..56affd9 100644 --- a/src/Model/Package/PackageFactory.php +++ b/src/Model/Package/PackageFactory.php @@ -15,8 +15,6 @@ public function create(string $carrier, array $data): Package; * @param array>|null $packages * @param array $data * - * @return \Inspirum\Balikobot\Model\Package\PackageCollection&array<\Inspirum\Balikobot\Model\Package\Package> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function createCollection(string $carrier, ?array $packages, array $data): PackageCollection; diff --git a/src/Model/Service/ServiceFactory.php b/src/Model/Service/ServiceFactory.php index b101917..558db7e 100644 --- a/src/Model/Service/ServiceFactory.php +++ b/src/Model/Service/ServiceFactory.php @@ -13,8 +13,6 @@ public function create(string $carrier, array $data): Service; /** * @param array $data - * - * @return \Inspirum\Balikobot\Model\Service\ServiceCollection&array<\Inspirum\Balikobot\Model\Service\Service> */ public function createCollection(string $carrier, array $data): ServiceCollection; } diff --git a/src/Model/Status/StatusFactory.php b/src/Model/Status/StatusFactory.php index 48c48b0..e4dea24 100644 --- a/src/Model/Status/StatusFactory.php +++ b/src/Model/Status/StatusFactory.php @@ -24,8 +24,6 @@ public function createLastStatus(string $carrier, array $data, array $response = * @param list $carrierIds * @param array $data * - * @return \Inspirum\Balikobot\Model\Status\StatusesCollection&array<\Inspirum\Balikobot\Model\Status\Statuses> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function createCollection(string $carrier, array $carrierIds, array $data): StatusesCollection; @@ -34,8 +32,6 @@ public function createCollection(string $carrier, array $carrierIds, array $data * @param list $carrierIds * @param array $data * - * @return \Inspirum\Balikobot\Model\Status\StatusCollection&array<\Inspirum\Balikobot\Model\Status\Status> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function createLastStatusCollection(string $carrier, array $carrierIds, array $data): StatusCollection; diff --git a/src/Model/Status/Statuses.php b/src/Model/Status/Statuses.php index 7793674..b2f57d1 100644 --- a/src/Model/Status/Statuses.php +++ b/src/Model/Status/Statuses.php @@ -12,8 +12,5 @@ */ interface Statuses extends Model, WithCarrierId { - /** - * @return \Inspirum\Balikobot\Model\Status\StatusCollection&array<\Inspirum\Balikobot\Model\Status\Status> - */ public function getStates(): StatusCollection; } diff --git a/src/Model/TransportCost/TransportCostFactory.php b/src/Model/TransportCost/TransportCostFactory.php index 8782c21..ca18c8d 100644 --- a/src/Model/TransportCost/TransportCostFactory.php +++ b/src/Model/TransportCost/TransportCostFactory.php @@ -14,8 +14,6 @@ public function create(string $carrier, array $data): TransportCost; /** * @param array> $packages * @param array $data - * - * @return \Inspirum\Balikobot\Model\TransportCost\TransportCostCollection&array<\Inspirum\Balikobot\Model\TransportCost\TransportCost> */ public function createCollection(string $carrier, ?array $packages, array $data): TransportCostCollection; } diff --git a/src/Service/InfoService.php b/src/Service/InfoService.php index daa6375..43c3068 100644 --- a/src/Service/InfoService.php +++ b/src/Service/InfoService.php @@ -19,8 +19,6 @@ public function getAccountInfo(): Account; /** * Get news in the Balikobot API * - * @return \Inspirum\Balikobot\Model\Changelog\ChangelogCollection&array<\Inspirum\Balikobot\Model\Changelog\Changelog> - * * @throws \Inspirum\Balikobot\Exception\Exception * @throws \Exception */ diff --git a/src/Service/PackageService.php b/src/Service/PackageService.php index ae515a0..25c6564 100644 --- a/src/Service/PackageService.php +++ b/src/Service/PackageService.php @@ -24,8 +24,6 @@ public function checkPackages(PackageDataCollection $packages): void; /** * Add packages * - * @return \Inspirum\Balikobot\Model\Package\PackageCollection&array<\Inspirum\Balikobot\Model\Package\Package> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function addPackages(PackageDataCollection $packages): PackageCollection; @@ -79,8 +77,6 @@ public function orderShipmentByPackageIds(string $carrier, array $packageIds): O /** * Get packages which was not yet sent * - * @return \Inspirum\Balikobot\Model\Package\PackageCollection&array<\Inspirum\Balikobot\Model\Package\Package> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function getOverview(string $carrier): PackageCollection; @@ -166,8 +162,6 @@ public function getProofOfDeliveriesByCarrierIds(string $carrier, array $carrier /** * Get the price of carriage at consignment level * - * @return \Inspirum\Balikobot\Model\TransportCost\TransportCostCollection&array<\Inspirum\Balikobot\Model\TransportCost\TransportCost> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function getTransportCosts(PackageDataCollection $packages): TransportCostCollection; @@ -189,8 +183,6 @@ public function orderPickup( /** * Order shipments from place B (typically supplier / previous consignee) to place A (shipping point) * - * @return \Inspirum\Balikobot\Model\Package\PackageCollection&array<\Inspirum\Balikobot\Model\Package\Package> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function orderB2AShipment(PackageDataCollection $packages): PackageCollection; @@ -198,8 +190,6 @@ public function orderB2AShipment(PackageDataCollection $packages): PackageCollec /** * Order shipments from place B (typically supplier / previous consignee) to place C (address other than shipping point) * - * @return \Inspirum\Balikobot\Model\Package\PackageCollection&array<\Inspirum\Balikobot\Model\Package\Package> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function orderB2CShipment(PackageDataCollection $packages): PackageCollection; diff --git a/src/Service/SettingService.php b/src/Service/SettingService.php index f898e73..f74ca96 100644 --- a/src/Service/SettingService.php +++ b/src/Service/SettingService.php @@ -19,8 +19,6 @@ interface SettingService /** * Get list of carriers * - * @return \Inspirum\Balikobot\Model\Carrier\CarrierCollection&array<\Inspirum\Balikobot\Model\Carrier\Carrier> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function getCarriers(): CarrierCollection; @@ -35,8 +33,6 @@ public function getCarrier(string $carrier): Carrier; /** * Get services for carrier * - * @return \Inspirum\Balikobot\Model\Service\ServiceCollection&array<\Inspirum\Balikobot\Model\Service\Service> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function getServices(string $carrier): ServiceCollection; @@ -44,8 +40,6 @@ public function getServices(string $carrier): ServiceCollection; /** * Get activated services for carrier * - * @return \Inspirum\Balikobot\Model\Service\ServiceCollection&array<\Inspirum\Balikobot\Model\Service\Service> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function getActivatedServices(string $carrier): ServiceCollection; @@ -53,8 +47,6 @@ public function getActivatedServices(string $carrier): ServiceCollection; /** * Get B2A services for carrier * - * @return \Inspirum\Balikobot\Model\Service\ServiceCollection&array<\Inspirum\Balikobot\Model\Service\Service> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function getB2AServices(string $carrier): ServiceCollection; @@ -62,8 +54,6 @@ public function getB2AServices(string $carrier): ServiceCollection; /** * Get manipulation units for carrier * - * @return \Inspirum\Balikobot\Model\ManipulationUnit\ManipulationUnitCollection&array<\Inspirum\Balikobot\Model\ManipulationUnit\ManipulationUnit> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function getManipulationUnits(string $carrier): ManipulationUnitCollection; @@ -71,8 +61,6 @@ public function getManipulationUnits(string $carrier): ManipulationUnitCollectio /** * Get activated manipulation units for carrier * - * @return \Inspirum\Balikobot\Model\ManipulationUnit\ManipulationUnitCollection&array<\Inspirum\Balikobot\Model\ManipulationUnit\ManipulationUnit> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function getActivatedManipulationUnits(string $carrier): ManipulationUnitCollection; @@ -80,8 +68,6 @@ public function getActivatedManipulationUnits(string $carrier): ManipulationUnit /** * Get available countries by service type * - * @return \Inspirum\Balikobot\Model\Service\ServiceCollection&array<\Inspirum\Balikobot\Model\Service\Service> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function getCountries(string $carrier): ServiceCollection; @@ -89,8 +75,6 @@ public function getCountries(string $carrier): ServiceCollection; /** * Get countries by service type where cash-on-delivery payment type is available * - * @return \Inspirum\Balikobot\Model\Service\ServiceCollection&array<\Inspirum\Balikobot\Model\Service\Service> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function getCodCountries(string $carrier): ServiceCollection; @@ -98,8 +82,6 @@ public function getCodCountries(string $carrier): ServiceCollection; /** * Get information about countries * - * @return \Inspirum\Balikobot\Model\Country\CountryCollection&array<\Inspirum\Balikobot\Model\Country\Country> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function getCountriesData(): CountryCollection; @@ -116,8 +98,6 @@ public function getZipCodes(string $carrier, string $service, ?string $country = /** * Get ADR units for carrier * - * @return \Inspirum\Balikobot\Model\AdrUnit\AdrUnitCollection&array<\Inspirum\Balikobot\Model\AdrUnit\AdrUnit> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function getAdrUnits(string $carrier): AdrUnitCollection; @@ -125,8 +105,6 @@ public function getAdrUnits(string $carrier): AdrUnitCollection; /** * Get available package data options for carrier * - * @return \Inspirum\Balikobot\Model\Attribute\AttributeCollection&array<\Inspirum\Balikobot\Model\Attribute\Attribute> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function getAddAttributes(string $carrier): AttributeCollection; @@ -134,8 +112,6 @@ public function getAddAttributes(string $carrier): AttributeCollection; /** * Get additional services (package data `services`) for carrier * - * @return \Inspirum\Balikobot\Model\Service\ServiceCollection&array<\Inspirum\Balikobot\Model\Service\Service> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function getAddServiceOptions(string $carrier): ServiceCollection; diff --git a/src/Service/TrackService.php b/src/Service/TrackService.php index bca144c..3aabaf5 100644 --- a/src/Service/TrackService.php +++ b/src/Service/TrackService.php @@ -30,8 +30,6 @@ public function trackPackageById(string $carrier, string $carrierId): Statuses; /** * Track packages * - * @return \Inspirum\Balikobot\Model\Status\StatusesCollection&array<\Inspirum\Balikobot\Model\Status\Statuses> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function trackPackages(PackageCollection $packages): StatusesCollection; @@ -41,8 +39,6 @@ public function trackPackages(PackageCollection $packages): StatusesCollection; * * @param list $carrierIds * - * @return \Inspirum\Balikobot\Model\Status\StatusesCollection&array<\Inspirum\Balikobot\Model\Status\Statuses> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function trackPackagesByIds(string $carrier, array $carrierIds): StatusesCollection; @@ -64,8 +60,6 @@ public function trackPackageLastStatusById(string $carrier, string $carrierId): /** * Track packages last statuses * - * @return \Inspirum\Balikobot\Model\Status\StatusCollection&array<\Inspirum\Balikobot\Model\Status\Status> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function trackPackagesLastStatuses(PackageCollection $packages): StatusCollection; @@ -75,8 +69,6 @@ public function trackPackagesLastStatuses(PackageCollection $packages): StatusCo * * @param list $carrierIds * - * @return \Inspirum\Balikobot\Model\Status\StatusCollection&array<\Inspirum\Balikobot\Model\Status\Status> - * * @throws \Inspirum\Balikobot\Exception\Exception */ public function trackPackagesLastStatusesByIds(string $carrier, array $carrierIds): StatusCollection;