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

Post   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 25
c 0
b 0
f 0
ccs 0
cts 6
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A set() 0 3 1
A get() 0 2 1
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