Failed Conditions
Push — develop ( d7a728...605806 )
by Elvis Henrique
04:12
created

Term::set()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 3
c 0
b 0
f 0
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 3
crap 2
1
<?php
2
/**
3
 * Term.
4
 *
5
 * @package App
6
 */
7
8
declare(strict_types=1);
9
10
namespace App\Services\Meta;
11
12
/**
13
 * Term class.
14
 */
15
class Term implements TermInterface {
16
17
	/**
18
	 * {@inheritDoc}
19
	 *
20
	 * @param integer $id Id.
21
	 * @param string  $key Key.
22
	 * @param boolean $single Single.
23
	 * @return mixed
24
	 */
25
	public function get( int $id, string $key, bool $single = false ) {
26
		return get_term_meta( $id, $key, $single );
27
	}
28
29
	/**
30
	 * {@inheritDoc}
31
	 *
32
	 * @param integer $id Id.
33
	 * @param string  $key Key.
34
	 * @param mixed   $value Value.
35
	 * @return IMeta
36
	 */
37
	public function set( int $id, string $key, $value ) : IMeta {
38
		update_term_meta( $id, $key, $value );
39
		return $this;
40
	}
41
}
42