Skip to content

Commit

Permalink
factory extends component factory
Browse files Browse the repository at this point in the history
  • Loading branch information
oallain authored and lchrusciel committed Sep 7, 2020
1 parent f4f0ed8 commit 0dd21de
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Sylius/Component/Core/Factory/ChannelFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Sylius\Component\Core\Factory;

use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Channel\Model\ChannelInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;

class ChannelFactory implements ChannelFactoryInterface
Expand All @@ -35,7 +35,7 @@ public function __construct(FactoryInterface $decoratedFactory, string $defaultC
*/
public function createNew(): ChannelInterface
{
/** @var ChannelInterface $channel */
/** @var \Sylius\Component\Core\Model\ChannelInterface $channel */
$channel = $this->decoratedFactory->createNew();
$channel->setTaxCalculationStrategy($this->defaultCalculationStrategy);

Expand Down
6 changes: 3 additions & 3 deletions src/Sylius/Component/Core/Factory/ChannelFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

namespace Sylius\Component\Core\Factory;

use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
use Sylius\Component\Channel\Factory\ChannelFactoryInterface as BaseChannelFactoryInterface;
use Sylius\Component\Channel\Model\ChannelInterface;

interface ChannelFactoryInterface extends FactoryInterface
interface ChannelFactoryInterface extends BaseChannelFactoryInterface
{
public function createNamed(string $name): ChannelInterface;
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ function it_is_a_resource_factory(): void
function it_creates_a_new_channel(FactoryInterface $decoratedFactory, ChannelInterface $channel): void
{
$decoratedFactory->createNew()->willReturn($channel);

$channel->setTaxCalculationStrategy('order_items_based')->shouldBeCalled();

$this->createNew()->shouldReturn($channel);
Expand Down

0 comments on commit 0dd21de

Please sign in to comment.