Skip to content

Commit

Permalink
[CS][DX] Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylius Bot authored and oallain committed Nov 13, 2023
1 parent 2c71274 commit 1e168c7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
Expand Up @@ -255,15 +255,17 @@ public function iSpecifyShopBillingDataAs(
): void {
$shopBillingDataId = $this->iriConverter->getIriFromResource($channel->getShopBillingData());

$this->client->addRequestData('shopBillingData', [
$this->client->addRequestData(
'shopBillingData',
[
'@id' => $shopBillingDataId,
'company' => $company,
'street' => $street,
'postcode' => $postcode,
'city' => $city,
'countryCode' => $country->getCode(),
'taxId' => $taxId
]
'taxId' => $taxId,
],
);
}

Expand Down
Expand Up @@ -20,7 +20,7 @@

final class ChannelDataPersister implements ContextAwareDataPersisterInterface
{
public function __construct (
public function __construct(
private ContextAwareDataPersisterInterface $decoratedDataPersister,
private ChannelDeletionCheckerInterface $channelDeletionChecker,
) {
Expand Down
Expand Up @@ -36,7 +36,7 @@ function it_supports_only_channel_entity(ChannelInterface $channel, \stdClass $o

function it_persists_channel(
ContextAwareDataPersisterInterface $decoratedDataPersister,
ChannelInterface $channel
ChannelInterface $channel,
): void {
$decoratedDataPersister->persist($channel, [])->willReturn($channel);

Expand All @@ -45,7 +45,7 @@ function it_persists_channel(

function it_throws_an_exception_if_channel_is_not_deletable(
ChannelDeletionCheckerInterface $channelDeletionChecker,
ChannelInterface $channel
ChannelInterface $channel,
): void {
$channelDeletionChecker->isDeletable($channel)->willReturn(false);

Expand All @@ -58,7 +58,7 @@ function it_throws_an_exception_if_channel_is_not_deletable(
function it_removes_channel(
ContextAwareDataPersisterInterface $decoratedDataPersister,
ChannelDeletionCheckerInterface $channelDeletionChecker,
ChannelInterface $channel
ChannelInterface $channel,
): void {
$channelDeletionChecker->isDeletable($channel)->willReturn(true);
$decoratedDataPersister->remove($channel, [])->willReturn(null);
Expand Down
Expand Up @@ -15,7 +15,6 @@

use PhpSpec\ObjectBehavior;
use Sylius\Component\Core\Model\OrderInterface;
use Sylius\Component\Core\Order\OrderItemNamesSetter;
use Sylius\Component\Core\Order\OrderItemNamesSetterInterface;
use Symfony\Component\Workflow\Event\CompletedEvent;
use Symfony\Component\Workflow\Marking;
Expand Down
Expand Up @@ -34,7 +34,7 @@ function it_returns_a_channel_can_be_deleted_when_is_disabled(ChannelInterface $
function it_returns_a_channel_can_be_deleted_when_at_least_two_channels_are_enabled(
ChannelRepositoryInterface $channelRepository,
ChannelInterface $channel,
ChannelInterface $anotherChannel
ChannelInterface $anotherChannel,
): void {
$channel->isEnabled()->willReturn(true);
$channelRepository->findEnabled()->willReturn([$channel, $anotherChannel]);
Expand All @@ -44,7 +44,7 @@ function it_returns_a_channel_can_be_deleted_when_at_least_two_channels_are_enab

function it_returns_a_channel_cannot_be_deleted_when_only_one_channel_is_enabled(
ChannelRepositoryInterface $channelRepository,
ChannelInterface $channel
ChannelInterface $channel,
): void {
$channel->isEnabled()->willReturn(true);
$channelRepository->findEnabled()->willReturn([$channel]);
Expand All @@ -54,7 +54,7 @@ function it_returns_a_channel_cannot_be_deleted_when_only_one_channel_is_enabled

function it_returns_a_channel_cannot_be_deleted_when_no_channel_is_enabled(
ChannelRepositoryInterface $channelRepository,
ChannelInterface $channel
ChannelInterface $channel,
): void {
$channel->isEnabled()->willReturn(true);
$channelRepository->findEnabled()->willReturn([]);
Expand Down

0 comments on commit 1e168c7

Please sign in to comment.