Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

Commit

Permalink
Fix misc errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sanmai committed Oct 18, 2020
1 parent 752872e commit de47cce
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/Requests/Templates/OrderRequest/Recipient.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ final class Recipient extends CommonRecipient implements ReadableRequestProperty
*/
public function __construct(?Address $address = null)
{
/** @phpstan-ignore-next-line */
$this->address = $address ?? new Address();
}
}
4 changes: 2 additions & 2 deletions src/Requests/Types/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
namespace YDeliverySDK\Requests\Types;

use CommonSDK\Concerns\PropertyWrite;
use CommonSDK\Contracts\Property;
use CommonSDK\Contracts\ReadableRequestProperty;
use JMS\Serializer\Annotation as JMS;

/**
* @property-write string $location
* @property-write int $geoId
* @property-write int[] $pickupPointIds
*/
final class Address implements Property
final class Address implements ReadableRequestProperty
{
use PropertyWrite;

Expand Down
4 changes: 2 additions & 2 deletions src/Requests/Types/Cost.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
namespace YDeliverySDK\Requests\Types;

use CommonSDK\Concerns\PropertyWrite;
use CommonSDK\Contracts\Property;
use CommonSDK\Contracts\ReadableRequestProperty;
use JMS\Serializer\Annotation as JMS;

/**
Expand All @@ -38,7 +38,7 @@
* @property-write float $manualDeliveryForCustomer
* @property-write bool $fullyPrepaid
*/
final class Cost implements Property
final class Cost implements ReadableRequestProperty
{
use PropertyWrite;

Expand Down
4 changes: 2 additions & 2 deletions src/Requests/Types/Dimensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
namespace YDeliverySDK\Requests\Types;

use CommonSDK\Concerns\PropertyWrite;
use CommonSDK\Contracts\Property;
use CommonSDK\Contracts\ReadableRequestProperty;
use JMS\Serializer\Annotation as JMS;

/**
Expand All @@ -38,7 +38,7 @@
* @property-write int $width
* @property-write float $weight
*/
final class Dimensions implements Property
final class Dimensions implements ReadableRequestProperty
{
use PropertyWrite;

Expand Down
4 changes: 2 additions & 2 deletions src/Requests/Types/Shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
namespace YDeliverySDK\Requests\Types;

use CommonSDK\Concerns\PropertyWrite;
use CommonSDK\Contracts\Property;
use CommonSDK\Contracts\ReadableRequestProperty;
use DateTimeInterface;
use JMS\Serializer\Annotation as JMS;

Expand All @@ -40,7 +40,7 @@
* @property-write int $warehouseId
* @property-write bool $includeNonDefault
*/
final class Shipment implements Property
final class Shipment implements ReadableRequestProperty
{
use PropertyWrite;

Expand Down
3 changes: 3 additions & 0 deletions src/Responses/CreateOrderResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ final class CreateOrderResponse implements Response, ScalarValue
*/
private $id;

/**
* @phan-suppress PhanAccessReadOnlyMagicProperty
*/
public static function withValue($value)
{
$response = new self();
Expand Down
2 changes: 1 addition & 1 deletion tests/Deserialization/ValidationErrorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ValidationErrorTest extends TestCase

public function test_it_deserializes()
{
/** @var $error ValidationError */
/** @var ValidationError $error */
$error = $this->getSerializer()->deserialize(self::EXAMPLE_ERROR, ValidationError::class);

$this->assertSame('FIELD_NOT_VALID', $error->getErrorCode());
Expand Down

0 comments on commit de47cce

Please sign in to comment.