Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
10 / 10
100.00% covered (success)
100.00%
6 / 6
CRAP
100.00% covered (success)
100.00%
1 / 1
SqliteBasket
100.00% covered (success)
100.00%
10 / 10
100.00% covered (success)
100.00%
6 / 6
7
100.00% covered (success)
100.00%
1 / 1
 setPdo
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 create
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
2
 applyOffer
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 add
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 remove
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getItems
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Alistaircol\Hta\Domain\Basket;
6
7use Alistaircol\Hta\Domain\Basket\Concerns\BasketInterface;
8use Alistaircol\Hta\Domain\Basket\Concerns\OfferInterface;
9use Alistaircol\Hta\Domain\Basket\Concerns\ProductInterface;
10use Alistaircol\Hta\Domain\Basket\DataTransferObjects\ProductInterfaceCollection;
11use DomainException;
12use PDO;
13
14class SqliteBasket extends AbstractBasket
15{
16    protected PDO $pdo;
17
18    public function setPdo(PDO $pdo)
19    {
20        $this->pdo = $pdo;
21    }
22
23    /**
24     * Create a new empty basket with optional offer.
25     *
26     * @param OfferInterface|null $offer
27     * @return BasketInterface
28     */
29    public function create(?OfferInterface $offer = null): BasketInterface
30    {
31        $this->items = new ProductInterfaceCollection();
32
33        if ($offer instanceof OfferInterface) {
34            $this->applyOffer($offer);
35        }
36
37        return $this;
38    }
39
40    public function applyOffer(OfferInterface $offer): BasketInterface
41    {
42        throw new DomainException('Not implemented');
43    }
44
45    public function add(ProductInterface $product): BasketInterface
46    {
47        parent::add($product);
48
49        throw new DomainException('Not implemented');
50    }
51
52    public function remove(ProductInterface $product): BasketInterface
53    {
54        throw new DomainException('Not implemented');
55    }
56
57    public function getItems(): ProductInterfaceCollection
58    {
59        throw new DomainException('Not implemented');
60    }
61}