RunnableDelete   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 6
c 0
b 0
f 0
dl 0
loc 19
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A prepare() 0 4 1
A run() 0 2 1
1
<?php
2
3
namespace Kir\MySQL\Builder;
4
5
use Kir\MySQL\Builder\Internal\DDLPreparable;
6
use Kir\MySQL\Builder\Internal\DDLRunnable;
7
use Kir\MySQL\Builder\Traits\CreateDDLRunnable;
8
9
/**
10
 * @implements DDLPreparable<int>
11
 */
12
class RunnableDelete extends Delete implements DDLPreparable {
13
	/** @use CreateDDLRunnable<int> */
14
	use CreateDDLRunnable;
15
16
	/**
17
	 * @param array<string, mixed> $params
18
	 * @return int
19
	 */
20
	public function run(array $params = []) {
21
		return $this->prepare()->run($params);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->prepare()->run($params) also could return the type Kir\MySQL\Builder\Internal\T which is incompatible with the documented return type integer.
Loading history...
22
	}
23
24
	/**
25
	 * @return DDLRunnable<int>
26
	 */
27
	public function prepare(): DDLRunnable {
28
		return $this->createPreparable(
29
			$this->db()->prepare($this),
30
			fn($v) => (int) $v
31
		);
32
	}
33
}
34