Skip to content

Commit

Permalink
Normalize return types
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-novotny committed Dec 12, 2024
1 parent 6e41fe0 commit ae73bba
Show file tree
Hide file tree
Showing 17 changed files with 0 additions and 75 deletions.
4 changes: 0 additions & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,3 @@ parameters:
message: '#^Method Inspirum\\Balikobot\\Model\\BasePerCarrierCollection\:\:first\(\) should return \(TValue of Inspirum\\Arrayable\\Arrayable\<TItemKey of \(int\|string\), TItemValue\>&Inspirum\\Balikobot\\Model\\WithCarrierId\)\|null but returns Inspirum\\Arrayable\\Arrayable\<TItemKey of \(int\|string\), TItemValue\>&Inspirum\\Balikobot\\Model\\WithCarrierId\.$#'
count: 1
path: src/Model/BasePerCarrierCollection.php
-
message: '#^PHPDoc tag \@return contains unresolvable type\.$#'
count: 35
path: src/**
2 changes: 0 additions & 2 deletions src/Model/AdrUnit/AdrUnitFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public function create(string $carrier, array $data): AdrUnit;

/**
* @param array<string,mixed> $data
*
* @return \Inspirum\Balikobot\Model\AdrUnit\AdrUnitCollection&array<\Inspirum\Balikobot\Model\AdrUnit\AdrUnit>
*/
public function createCollection(string $carrier, array $data): AdrUnitCollection;
}
2 changes: 0 additions & 2 deletions src/Model/Attribute/AttributeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public function create(array $data): Attribute;

/**
* @param array<string,mixed> $data
*
* @return \Inspirum\Balikobot\Model\Attribute\AttributeCollection&array<\Inspirum\Balikobot\Model\Attribute\Attribute>
*/
public function createCollection(string $carrier, array $data): AttributeCollection;
}
2 changes: 0 additions & 2 deletions src/Model/Carrier/CarrierFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public function create(string $carrier, array $data): Carrier;

/**
* @param array<array<int,mixed>> $data
*
* @return \Inspirum\Balikobot\Model\Carrier\CarrierCollection&array<\Inspirum\Balikobot\Model\Carrier\Carrier>
*/
public function createCollection(array $data): CarrierCollection;
}
2 changes: 0 additions & 2 deletions src/Model/Changelog/ChangelogFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public function create(array $data): Changelog;
/**
* @param array<string,mixed> $data
*
* @return \Inspirum\Balikobot\Model\Changelog\ChangelogCollection&array<\Inspirum\Balikobot\Model\Changelog\Changelog>
*
* @throws \Exception
*/
public function createCollection(array $data): ChangelogCollection;
Expand Down
2 changes: 0 additions & 2 deletions src/Model/Country/CountryFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public function create(array $data): Country;

/**
* @param array<string,mixed> $data
*
* @return \Inspirum\Balikobot\Model\Country\CountryCollection&array<\Inspirum\Balikobot\Model\Country\Country>
*/
public function createCollection(array $data): CountryCollection;

Expand Down
2 changes: 0 additions & 2 deletions src/Model/ManipulationUnit/ManipulationUnitFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public function create(array $data): ManipulationUnit;

/**
* @param array<string,mixed> $data
*
* @return \Inspirum\Balikobot\Model\ManipulationUnit\ManipulationUnitCollection&array<\Inspirum\Balikobot\Model\ManipulationUnit\ManipulationUnit>
*/
public function createCollection(string $carrier, array $data): ManipulationUnitCollection;
}
2 changes: 0 additions & 2 deletions src/Model/Method/MethodFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public function create(array $data): Method;

/**
* @param array<array<string,string>> $data
*
* @return \Inspirum\Balikobot\Model\Method\MethodCollection&array<\Inspirum\Balikobot\Model\Method\Method>
*/
public function createCollection(array $data): MethodCollection;
}
2 changes: 0 additions & 2 deletions src/Model/Package/PackageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public function create(string $carrier, array $data): Package;
* @param array<int,array<string,mixed>>|null $packages
* @param array<string,mixed> $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;
Expand Down
2 changes: 0 additions & 2 deletions src/Model/Service/ServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public function create(string $carrier, array $data): Service;

/**
* @param array<string,mixed> $data
*
* @return \Inspirum\Balikobot\Model\Service\ServiceCollection&array<\Inspirum\Balikobot\Model\Service\Service>
*/
public function createCollection(string $carrier, array $data): ServiceCollection;
}
4 changes: 0 additions & 4 deletions src/Model/Status/StatusFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ public function createLastStatus(string $carrier, array $data, array $response =
* @param list<string> $carrierIds
* @param array<mixed,mixed> $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;
Expand All @@ -34,8 +32,6 @@ public function createCollection(string $carrier, array $carrierIds, array $data
* @param list<string> $carrierIds
* @param array<mixed,mixed> $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;
Expand Down
3 changes: 0 additions & 3 deletions src/Model/Status/Statuses.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 0 additions & 2 deletions src/Model/TransportCost/TransportCostFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ public function create(string $carrier, array $data): TransportCost;
/**
* @param array<int,array<string,mixed>> $packages
* @param array<string,mixed> $data
*
* @return \Inspirum\Balikobot\Model\TransportCost\TransportCostCollection&array<\Inspirum\Balikobot\Model\TransportCost\TransportCost>
*/
public function createCollection(string $carrier, ?array $packages, array $data): TransportCostCollection;
}
2 changes: 0 additions & 2 deletions src/Service/InfoService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
10 changes: 0 additions & 10 deletions src/Service/PackageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -189,17 +183,13 @@ 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;

/**
* 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;
Expand Down
24 changes: 0 additions & 24 deletions src/Service/SettingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -35,71 +33,55 @@ 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;

/**
* 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;

/**
* 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;

/**
* 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;

/**
* 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;

/**
* 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;

/**
* 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;

/**
* 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;
Expand All @@ -116,26 +98,20 @@ 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;

/**
* 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;

/**
* 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;
Expand Down
8 changes: 0 additions & 8 deletions src/Service/TrackService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -41,8 +39,6 @@ public function trackPackages(PackageCollection $packages): StatusesCollection;
*
* @param list<string> $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;
Expand All @@ -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;
Expand All @@ -75,8 +69,6 @@ public function trackPackagesLastStatuses(PackageCollection $packages): StatusCo
*
* @param list<string> $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;
Expand Down

0 comments on commit ae73bba

Please sign in to comment.