Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
Merge 0c5d953 into 1eed434
Browse files Browse the repository at this point in the history
  • Loading branch information
sanmai committed Jan 24, 2019
2 parents 1eed434 + 0c5d953 commit b483a8c
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
parameters:
excludes_analyse:
- %currentWorkingDirectory%/tests/Common/MagicSettersTest.php
ignoreErrors:
- '#@return has invalid value.*ArrayIterator<array-key,#'
30 changes: 15 additions & 15 deletions src/CdekClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@
/**
* Class CdekClient.
*
* @method Responses\DeleteResponse sendDeleteRequest(Requests\DeleteRequest $request)
* @method Responses\PvzListResponse<Common\Pvz> sendPvzListRequest(Requests\PvzListRequest $request)
* @method Responses\DeliveryResponse sendDeliveryRequest(Requests\DeliveryRequest $request)
* @method Responses\DeliveryResponse sendAddDeliveryRequest(Requests\AddDeliveryRequest $request)
* @method Responses\UpdateResponse sendUpdateRequest(Requests\UpdateRequest $request)
* @method Responses\CallCourierResponse sendCallCourierRequest(Requests\CallCourierRequest $request)
* @method Responses\ScheduleResponse sendScheduleRequest(Requests\ScheduleRequest $request)
* @method Responses\PreAlertResponse sendPreAlertRequest(Requests\PreAlertRequest $request)
* @method Responses\InfoReportResponse<Common\Order> sendInfoReportRequest(Requests\InfoReportRequest $request)
* @method Responses\CalculationResponse sendCalculationRequest(Requests\CalculationRequest $request)
* @method Responses\StatusReportResponse<Common\Order> sendStatusReportRequest(Requests\StatusReportRequest $request)
* @method Responses\FileResponse sendPrintReceiptsRequest(Requests\PrintReceiptsRequest $request)
* @method Responses\FileResponse sendPrintLabelsRequest(Requests\PrintLabelsRequest $request)
* @method Responses\RegionsResponse<Common\Region> sendRegionsRequest(Requests\RegionsRequest $request)
* @method Responses\CitiesResponse<Common\Location> sendCitiesRequest(Requests\CitiesRequest $request)
* @method Responses\DeleteResponse sendDeleteRequest(Requests\DeleteRequest $request)
* @method Responses\PvzListResponse sendPvzListRequest(Requests\PvzListRequest $request)
* @method Responses\DeliveryResponse sendDeliveryRequest(Requests\DeliveryRequest $request)
* @method Responses\DeliveryResponse sendAddDeliveryRequest(Requests\AddDeliveryRequest $request)
* @method Responses\UpdateResponse sendUpdateRequest(Requests\UpdateRequest $request)
* @method Responses\CallCourierResponse sendCallCourierRequest(Requests\CallCourierRequest $request)
* @method Responses\ScheduleResponse sendScheduleRequest(Requests\ScheduleRequest $request)
* @method Responses\PreAlertResponse sendPreAlertRequest(Requests\PreAlertRequest $request)
* @method Responses\InfoReportResponse sendInfoReportRequest(Requests\InfoReportRequest $request)
* @method Responses\CalculationResponse sendCalculationRequest(Requests\CalculationRequest $request)
* @method Responses\StatusReportResponse sendStatusReportRequest(Requests\StatusReportRequest $request)
* @method Responses\FileResponse sendPrintReceiptsRequest(Requests\PrintReceiptsRequest $request)
* @method Responses\FileResponse sendPrintLabelsRequest(Requests\PrintLabelsRequest $request)
* @method Responses\RegionsResponse sendRegionsRequest(Requests\RegionsRequest $request)
* @method Responses\CitiesResponse sendCitiesRequest(Requests\CitiesRequest $request)
*/
final class CdekClient implements Contracts\Client, LoggerAwareInterface
{
Expand Down
6 changes: 5 additions & 1 deletion src/Responses/CitiesResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

/**
* Class CitiesResponse.
*
* @template-implements IteratorAggregate<Location>
*/
final class CitiesResponse implements \IteratorAggregate, Response
{
Expand All @@ -54,7 +56,9 @@ public function getItems(): array
}

/**
* @return \Traversable|Location[]
* @phan-suppress PhanUnextractableAnnotationSuffix
*
* @return \ArrayIterator<array-key, Location>
*/
public function getIterator()
{
Expand Down
6 changes: 5 additions & 1 deletion src/Responses/InfoReportResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@

/**
* Class InfoReportResponse.
*
* @template-implements IteratorAggregate<Common\Order>
*/
final class InfoReportResponse implements Response, \IteratorAggregate
{
Expand All @@ -58,7 +60,9 @@ public function getOrders()
}

/**
* @return \Traversable|Order[]
* @phan-suppress PhanUnextractableAnnotationSuffix
*
* @return \ArrayIterator<array-key, Order>
*/
public function getIterator()
{
Expand Down
6 changes: 5 additions & 1 deletion src/Responses/PvzListResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

/**
* Class PvzListResponse.
*
* @template-implements IteratorAggregate<Common\Pvz>
*/
final class PvzListResponse implements Response, \IteratorAggregate
{
Expand All @@ -54,7 +56,9 @@ public function getItems(): array
}

/**
* @return \Traversable|Pvz[]
* @phan-suppress PhanUnextractableAnnotationSuffix
*
* @return \ArrayIterator<array-key, Pvz>
*/
public function getIterator()
{
Expand Down
6 changes: 5 additions & 1 deletion src/Responses/RegionsResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

/**
* Class RegionsResponse.
*
* @template-implements IteratorAggregate<Common\Region>
*/
final class RegionsResponse implements \IteratorAggregate, Response
{
Expand All @@ -54,7 +56,9 @@ public function getItems(): array
}

/**
* @return \Traversable|Region[]
* @phan-suppress PhanUnextractableAnnotationSuffix
*
* @return \ArrayIterator<array-key, Region>
*/
public function getIterator()
{
Expand Down
6 changes: 5 additions & 1 deletion src/Responses/StatusReportResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@

/**
* Class StatusReportResponse.
*
* @template-implements IteratorAggregate<Common\Order>
*/
final class StatusReportResponse implements Response, HasErrorCode, \IteratorAggregate
{
Expand Down Expand Up @@ -98,7 +100,9 @@ public function getOrders()
}

/**
* @return \Traversable|Order[]
* @phan-suppress PhanUnextractableAnnotationSuffix
*
* @return \ArrayIterator<array-key, Order>
*/
public function getIterator()
{
Expand Down
1 change: 1 addition & 0 deletions src/Serialization/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public function __construct()
// Ignore Phan/Psalm issue-suppressing annotations
AnnotationReader::addGlobalIgnoredName('phan');
AnnotationReader::addGlobalIgnoredName('psalm');
AnnotationReader::addGlobalIgnoredName('template');

if (self::$configureAnnotationRegistry) {
self::configureAnnotationRegistry();
Expand Down
1 change: 0 additions & 1 deletion tests/Integration/CitiesRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public function test_with_null_payment_limit()
$request = new CitiesRequest();
$request->setRegionCode(9);

/** @var CitiesResponse $response */
$response = $this->getClient()->sendCitiesRequest($request);

$this->skipIfKnownAPIErrorCode($response);
Expand Down

0 comments on commit b483a8c

Please sign in to comment.