Completed
Push — master ( aef970...c04073 )
by Ron
02:26
created

WhereBuilder::where()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 4
Ratio 100 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 4
loc 4
rs 10
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
namespace Kir\MySQL\Builder\Traits;
3
4
use Kir\MySQL\Builder\Internal\ConditionBuilder;
5
6 View Code Duplication
trait WhereBuilder {
0 ignored issues
show
Duplication introduced by
This class 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.

Loading history...
7
	use AbstractDB;
8
9
	/** @var array */
10
	private $where = array();
11
12
	/**
13
	 * @param string $expression
14
	 * @param mixed ...$param
15
	 * @return $this
16
	 */
17
	public function where($expression) {
18
		$this->where[] = [$expression, array_slice(func_get_args(), 1)];
19
		return $this;
20
	}
21
22
	/**
23
	 * @param string $query
24
	 * @return string
25
	 */
26
	protected function buildWhereConditions($query) {
27
		return ConditionBuilder::build($this->db(), $query, $this->where, 'WHERE');
28
	}
29
}
30