Completed
Push — master ( 678089...988510 )
by Andrii
02:43
created

SimpleSaleRepository::findByOrder()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * PHP Billing Library
4
 *
5
 * @link      https://github.com/hiqdev/php-billing
6
 * @package   php-billing
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2017-2018, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\php\billing\tests\support\sale;
12
13
use hiqdev\php\billing\action\ActionInterface;
14
use hiqdev\php\billing\order\OrderInterface;
15
use hiqdev\php\billing\sale\SaleInterface;
16
use hiqdev\php\billing\sale\SaleRepositoryInterface;
17
18
class SimpleSaleRepository implements SaleRepositoryInterface
19
{
20
    protected $sale;
21
22
    public function __construct(SaleInterface $sale)
23
    {
24
        $this->sale = $sale;
25
    }
26
27
    public function findByAction(ActionInterface $action)
0 ignored issues
show
Unused Code introduced by
The parameter $action is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

27
    public function findByAction(/** @scrutinizer ignore-unused */ ActionInterface $action)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
28
    {
29
        return $this->sale;
30
    }
31
32
    public function findByOrder(OrderInterface $order)
33
    {
34
        $sales = [];
35
        foreach ($order->getActions() as $actionKey => $action) {
36
            $sales[$actionKey] = $this->findByAction($action);
37
        }
38
39
        return $sales;
40
    }
41
42
    public function findByIds(array $ids)
0 ignored issues
show
Unused Code introduced by
The parameter $ids is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

42
    public function findByIds(/** @scrutinizer ignore-unused */ array $ids)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
43
    {
44
        throw new \Exception('not implemented');
45
    }
46
}
47