Completed
Pull Request — master (#9)
by Dmitry
12:43
created

BillSearchCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 2
b 0
f 0
dl 0
loc 17
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getEntityClass() 0 3 1
A filters() 0 10 1
1
<?php
2
3
namespace hiqdev\billing\hiapi\bill\Search;
4
5
use hiapi\commands\Search\Filter\Type\IntegerFilter;
0 ignored issues
show
Bug introduced by
The type hiapi\commands\Search\Filter\Type\IntegerFilter was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use hiapi\commands\SearchCommand;
7
use hiqdev\billing\hiapi\models\Bill as BillModel;
8
use hiapi\commands\Search\Filter\Type\GenericFilter as Filter;
0 ignored issues
show
Bug introduced by
The type hiapi\commands\Search\Filter\Type\GenericFilter was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use hiqdev\billing\hiapi\models\Customer;
10
use hiqdev\billing\hiapi\models\Money;
11
use hiqdev\billing\hiapi\models\Plan;
12
use hiqdev\billing\hiapi\models\Quantity;
13
use hiqdev\billing\hiapi\models\Target;
14
use hiqdev\billing\hiapi\models\Type;
15
use hiqdev\yii\DataMapper\query\attributes\DateTimeAttribute;
16
use hiqdev\yii\DataMapper\query\attributes\IntegerAttribute;
17
use hiqdev\yii\DataMapper\validators\WhereValidator;
0 ignored issues
show
Bug introduced by
The type hiqdev\yii\DataMapper\validators\WhereValidator was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
18
19
class BillSearchCommand extends SearchCommand
20
{
21
    public function getEntityClass(): string
22
    {
23
        return Bill::class;
24
    }
25
26
    public function filters()
27
    {
28
        $filters = new FiltersCollection();
0 ignored issues
show
Bug introduced by
The type hiqdev\billing\hiapi\bill\Search\FiltersCollection was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
29
        $filters->addMultiple(
30
            // Probably good. Except too many boilerplate classes and imperative code style
31
            new IntegerFilter('id'),
32
            // Also may be good, but harder to extend
33
            Filter::integer('seller_id'),
34
            // Would not go this way
35
            ['client_id', Filter::INTEGER],
36
37
//            new IntegerFilter('object_id'),
38
//            new RefFilter('type'),
39
//            new MoneyFilter('sum'),
40
//            new DateTimeFilter('time')
41
        );
42
    }
43
}
44