Skip to content

Commit

Permalink
pr-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SirDomin committed Jun 17, 2021
1 parent b3ff3ba commit 7d30efa
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 18 deletions.
2 changes: 1 addition & 1 deletion UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
LineItemsConverterInterface $shipmentLineItemsConverter,
TaxItemsGeneratorInterface $taxItemsGenerator,
CreditMemoFactoryInterface $creditMemoFactory,
+ CustomerBillingDataFactoryInterface $customerBillingDataFactory
+ CustomerBillingDataFactoryInterface $customerBillingDataFactory,
+ ShopBillingDataFactoryInterface $shopBillingDataFactory
) {
...
Expand Down
5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ parameters:
- '/Method Sylius\\RefundPlugin\\Entity\\CustomerBillingData::setId\(\) has parameter \$id with no typehint specified./'
- '/Method Sylius\\RefundPlugin\\Entity\\CustomerBillingDataInterface::id\(\) has no return typehint specified./'
- '/Method Sylius\\RefundPlugin\\Entity\\CustomerBillingDataInterface::setId\(\) has parameter \$id with no typehint specified./'
- '/Method Sylius\\RefundPlugin\\Entity\\ShopBillingData::id\(\) has no return typehint specified./'
- '/Method Sylius\\RefundPlugin\\Entity\\ShopBillingData::getId\(\) has no return typehint specified./'
- '/Method Sylius\\RefundPlugin\\Entity\\ShopBillingData::setId\(\) has parameter \$id with no typehint specified./'
- '/Method Sylius\\RefundPlugin\\Entity\\ShopBillingData::id\(\) has no return typehint specified./'
- '/Method Sylius\\RefundPlugin\\Entity\\ShopBillingData::setId\(\) has parameter \$id with no typehint specified./'
12 changes: 6 additions & 6 deletions spec/Entity/ShopBillingDataSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,37 @@ public function it_has_no_id_by_default(): void
$this->getId()->shouldReturn(null);
}

public function it_has_company(): void
public function it_has_a_company(): void
{
$this->setCompany('Needful Things');
$this->getCompany()->shouldReturn('Needful Things');
}

public function it_has_tax_id(): void
public function it_has_a_tax_id(): void
{
$this->setTaxId('000222');
$this->getTaxId()->shouldReturn('000222');
}

public function it_has_country_code(): void
public function it_has_a_country_code(): void
{
$this->setCountryCode('US');
$this->getCountryCode()->shouldReturn('US');
}

public function it_has_street(): void
public function it_has_a_street(): void
{
$this->setStreet('Main St. 123');
$this->getStreet()->shouldReturn('Main St. 123');
}

public function it_has_city(): void
public function it_has_a_city(): void
{
$this->setCity('Los Angeles');
$this->getCity()->shouldReturn('Los Angeles');
}

public function it_has_postcode(): void
public function it_has_a_postcode(): void
{
$this->setPostcode('90001');
$this->getPostcode()->shouldReturn('90001');
Expand Down
8 changes: 4 additions & 4 deletions src/Entity/ShopBillingData.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/** final */
class ShopBillingData implements ShopBillingDataInterface
{
/** @var int|null */
/** @var mixed */
protected $id;

/** @var string|null */
Expand All @@ -37,12 +37,12 @@ class ShopBillingData implements ShopBillingDataInterface
/** @var string|null */
protected $postcode;

public function getId(): ?int
public function getId()
{
return $this->id;
}

public function setId(?int $id): void
public function setId($id): void
{
$this->id = $id;
}
Expand Down Expand Up @@ -107,7 +107,7 @@ public function setPostcode(?string $postcode): void
$this->postcode = $postcode;
}

public function id(): ?int
public function id()
{
return $this->id;
}
Expand Down
25 changes: 23 additions & 2 deletions src/Entity/ShopBillingDataInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

interface ShopBillingDataInterface extends ResourceInterface
{
public function getId(): ?int;
public function getId();

public function setId(?int $id): void;
public function setId($id): void;

public function getCompany(): ?string;

Expand All @@ -44,4 +44,25 @@ public function setCity(?string $city): void;
public function getPostcode(): ?string;

public function setPostcode(?string $postcode): void;

/** @deprecated this function is deprecated and will be removed in v1.0.0. Use CustomerBillingDataInterface::getId() instead */
public function id();

/** @deprecated this function is deprecated and will be removed in v1.0.0. Use CustomerBillingDataInterface::getCompany() instead */
public function company(): ?string;

/** @deprecated this function is deprecated and will be removed in v1.0.0. Use CustomerBillingDataInterface::getTaxId() instead */
public function taxId(): ?string;

/** @deprecated this function is deprecated and will be removed in v1.0.0. Use CustomerBillingDataInterface::getCountryCode() instead */
public function countryCode(): ?string;

/** @deprecated this function is deprecated and will be removed in v1.0.0. Use CustomerBillingDataInterface::getStreet() instead */
public function street(): ?string;

/** @deprecated this function is deprecated and will be removed in v1.0.0. Use CustomerBillingDataInterface::getCity() instead */
public function city(): ?string;

/** @deprecated this function is deprecated and will be removed in v1.0.0. Use CustomerBillingDataInterface::getPostcode() instead */
public function postcode(): ?string;
}
2 changes: 1 addition & 1 deletion src/Generator/CreditMemoGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
use Sylius\RefundPlugin\Converter\LineItemsConverterInterface;
use Sylius\RefundPlugin\Entity\CreditMemoInterface;
use Sylius\RefundPlugin\Entity\CustomerBillingDataInterface;
use Sylius\RefundPlugin\Entity\ShopBillingDataInterface;
use Sylius\RefundPlugin\Factory\CreditMemoFactoryInterface;
use Sylius\RefundPlugin\Factory\CustomerBillingDataFactoryInterface;
use Sylius\RefundPlugin\Entity\ShopBillingDataInterface;
use Sylius\RefundPlugin\Factory\ShopBillingDataFactoryInterface;
use Sylius\RefundPlugin\Model\OrderItemUnitRefund;
use Sylius\RefundPlugin\Model\ShipmentRefund;
Expand Down
8 changes: 4 additions & 4 deletions src/Resources/config/services/generators.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
</service>

<service
id="Sylius\RefundPlugin\Factory\ShopBillingDataFactory"
decorates="sylius_refund.factory.shop_billing_data"
decoration-priority="256"
public="false"
id="Sylius\RefundPlugin\Factory\ShopBillingDataFactory"
decorates="sylius_refund.factory.shop_billing_data"
decoration-priority="256"
public="false"
>
<argument type="service" id="Sylius\RefundPlugin\Factory\ShopBillingDataFactory.inner" />
</service>
Expand Down

0 comments on commit 7d30efa

Please sign in to comment.