This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
0 ignored issues
–
show
|
|||
2 | |||
3 | require __DIR__.'/../vendor/autoload.php'; |
||
4 | |||
5 | /** |
||
6 | * Created by PhpStorm. |
||
7 | * User: admin |
||
8 | * Date: 21.01.2018 |
||
9 | * Time: 14:25 |
||
10 | */ |
||
11 | |||
12 | $connection = new \sonrac\Arango\Connection([ |
||
13 | |||
14 | \ArangoDBClient\ConnectionOptions::OPTION_ENDPOINT => 'tcp://arangodb:8529', |
||
15 | \ArangoDBClient\ConnectionOptions::OPTION_DATABASE => 'test', |
||
16 | \ArangoDBClient\ConnectionOptions::OPTION_AUTH_USER => 'root', |
||
17 | \ArangoDBClient\ConnectionOptions::OPTION_AUTH_PASSWD => 'test', |
||
18 | ]); |
||
19 | |||
20 | $processor = new \sonrac\Arango\Query\Processors\Processor(); |
||
21 | |||
22 | $grammar = new \sonrac\Arango\Query\Grammars\Grammar(); |
||
23 | |||
24 | $builder = new \sonrac\Arango\Query\QueryBuilder($connection, $grammar, $processor); |
||
25 | |||
26 | function selectWhere($builder) |
||
27 | { |
||
28 | $builder = $builder->select()->from('documents')->where('data', 1); |
||
29 | $aql = $builder->toAql(); |
||
30 | echo $aql . "\r\n"; |
||
31 | $data = $builder->get(); |
||
32 | var_dump($data); |
||
0 ignored issues
–
show
|
|||
33 | } |
||
34 | |||
35 | function selectWhereNot($builder) |
||
36 | { |
||
37 | $builder = $builder->select()->from('documents')->whereNot('data', 1); |
||
38 | $aql = $builder->toAql(); |
||
39 | echo $aql . "\r\n"; |
||
40 | $data = $builder->get(); |
||
41 | var_dump($data); |
||
0 ignored issues
–
show
|
|||
42 | } |
||
43 | |||
44 | function selectWhereAnd($builder) |
||
45 | { |
||
46 | $builder = $builder->select()->from('documents')->where('data', 1)->whereNot('data', 2); |
||
47 | $aql = $builder->toAql(); |
||
48 | echo $aql . "\r\n"; |
||
49 | $data = $builder->get(); |
||
50 | var_dump($data); |
||
0 ignored issues
–
show
|
|||
51 | } |
||
52 | |||
53 | function selectWhereIn($builder) |
||
54 | { |
||
55 | $builder = $builder->select()->from('documents')->whereIn('data', [1, 2]); |
||
56 | $aql = $builder->toAql(); |
||
57 | echo $aql . "\r\n"; |
||
58 | $data = $builder->get(); |
||
59 | var_dump($data); |
||
0 ignored issues
–
show
|
|||
60 | } |
||
61 | |||
62 | function selectWhereNotIn($builder) |
||
63 | { |
||
64 | $builder = $builder->select()->from('documents')->whereNotIn('data', [1, 2]); |
||
65 | $aql = $builder->toAql(); |
||
66 | echo $aql . "\r\n"; |
||
67 | $data = $builder->get(); |
||
68 | var_dump($data); |
||
0 ignored issues
–
show
|
|||
69 | } |
||
70 | |||
71 | function selectWhereBetween($builder) |
||
72 | { |
||
73 | $builder = $builder->select()->from('documents')->whereBetween('data', [0, 4]); |
||
74 | $aql = $builder->toAql(); |
||
75 | echo $aql . "\r\n"; |
||
76 | $data = $builder->get(); |
||
77 | var_dump($data); |
||
0 ignored issues
–
show
|
|||
78 | } |
||
79 | |||
80 | function selectWhereNotBetween($builder) |
||
81 | { |
||
82 | $builder = $builder->select()->from('documents')->whereNotBetween('data', [5, 90]); |
||
83 | $aql = $builder->toAql(); |
||
84 | echo $aql . "\r\n"; |
||
85 | $data = $builder->get(); |
||
86 | var_dump($data); |
||
0 ignored issues
–
show
|
|||
87 | } |
||
88 | |||
89 | View Code Duplication | function selectWhereBetweenAnd($builder) |
|
0 ignored issues
–
show
This function seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
90 | { |
||
91 | $builder = $builder->select()->from('documents')->whereBetween('data', [0, 4])->where('data', 1); |
||
92 | $aql = $builder->toAql(); |
||
93 | echo $aql . "\r\n"; |
||
94 | $data = $builder->get(); |
||
95 | var_dump($data); |
||
0 ignored issues
–
show
|
|||
96 | } |
||
97 | View Code Duplication | function selectWhereBetweenOr($builder) |
|
0 ignored issues
–
show
This function seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
98 | { |
||
99 | $builder = $builder->select()->from('documents')->whereBetween('data', [0, 4])->orWhere('votes', 0); |
||
100 | $aql = $builder->toAql(); |
||
101 | echo $aql . "\r\n"; |
||
102 | $data = $builder->get(); |
||
103 | var_dump($data); |
||
0 ignored issues
–
show
|
|||
104 | } |
||
105 | |||
106 | $connection->table('users')->truncate(); |
||
107 | |||
108 | $builder->where('test.a', '123'); |
||
109 |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.