QueryConditionFactory::getDriverNamePrefix()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Trucker\Factories;
4
5
use Trucker\Facades\Config;
6
use Trucker\Framework\FactoryDriver;
7
8
class QueryConditionFactory extends FactoryDriver
9
{
10
    /**
11
     * Function to return a string representaion of the namespace
12
     * that all classes built by the factory should be contained within.
13
     *
14
     * @return string - namespace string
15
     */
16 4
    public function getDriverNamespace()
17
    {
18 4
        return "\Trucker\Finders\Conditions";
19
    }
20
21
    /**
22
     * Function to return the interface that the driver's produced
23
     * by the factory must implement.
24
     *
25
     * @return string
26
     */
27 3
    public function getDriverInterface()
28
    {
29 3
        return "\Trucker\Finders\Conditions\QueryConditionInterface";
30
    }
31
32
    /**
33
     * Function to return a string that should be suffixed
34
     * to the studly-cased driver name of all the drivers
35
     * that the factory can return.
36
     *
37
     * @return string
38
     */
39 4
    public function getDriverNameSuffix()
40
    {
41 4
        return 'QueryCondition';
42
    }
43
44
    /**
45
     * Function to return a string that should be prefixed
46
     * to the studly-cased driver name of all the drivers
47
     * that the factory can return.
48
     *
49
     * @return string
50
     */
51 4
    public function getDriverNamePrefix()
52
    {
53 4
        return '';
54
    }
55
56
    /**
57
     * Function to return an array of arguments that should be
58
     * passed to the constructor of a new driver instance.
59
     *
60
     * @return array
61
     */
62 3
    public function getDriverArgumentsArray()
63
    {
64 3
        return [$this->app];
65
    }
66
67
    /**
68
     * Function to return the string representation of the driver
69
     * itslef based on a value fetched from the config file.  This
70
     * function will itself access the config, and return the driver
71
     * setting.
72
     *
73
     * @return string
74
     */
75 4
    public function getDriverConfigValue()
76
    {
77 4
        return Config::get('query_condition.driver');
0 ignored issues
show
Bug introduced by
The method get() does not exist on Trucker\Facades\Config. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

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

77
        return Config::/** @scrutinizer ignore-call */ get('query_condition.driver');
Loading history...
78
    }
79
}
80