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

Post::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 2
c 0
b 0
f 0
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 3
crap 2
1
<?php
2
/**
3
 * Post.
4
 *
5
 * @package App
6
 */
7
8
declare(strict_types=1);
9
10
namespace App\Services\Meta;
11
12
/**
13
 * Post class.
14
 */
15
class Post implements PostInterface {
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_post_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_post_meta( $id, $key, $value );
39
		return $this;
40
	}
41
}
42