RunnableDelete::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 2
c 0
b 0
f 0
rs 10
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
namespace Kir\MySQL\Builder;
3
4
use Kir\MySQL\Builder\Internal\DDLPreparable;
5
use Kir\MySQL\Builder\Internal\DDLRunnable;
6
use Kir\MySQL\Builder\Traits\CreateDDLRunnable;
7
8
/**
9
 * @implements DDLPreparable<int>
10
 */
11
class RunnableDelete extends Delete implements DDLPreparable {
12
	/** @use CreateDDLRunnable<int> */
13
	use CreateDDLRunnable;
14
15
	/**
16
	 * @param array<string, mixed> $params
17
	 * @return int
18
	 */
19
	public function run(array $params = []) {
20
		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...
21
	}
22
23
	/**
24
	 * @return DDLRunnable<int>
25
	 */
26
	public function prepare(): DDLRunnable {
27
		return $this->createPreparable(
28
			$this->db()->prepare($this),
29
			fn($v) => (int) $v
30
		);
31
	}
32
}
33