Passed
Push — develop ( 7b6b21...481580 )
by Elvis Henrique
03:48
created

CarbonTerm::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
/**
3
 * Carbon Term.
4
 *
5
 * @package App
6
 */
7
8
declare(strict_types=1);
9
10
namespace App\Services\Meta;
11
12
use Carbon_Fields\Helper\Helper as CarbonHelper;
13
use WPSteak\Services\Meta\IMeta;
14
use WPSteak\Services\Meta\TermInterface;
15
16
/**
17
 * Carbon Term class.
18
 *
19
 * @codeCoverageIgnore
20
 */
21
class CarbonTerm implements TermInterface {
22
23
	/**
24
	 * Helper.
25
	 *
26
	 * @var CarbonHelper
27
	 */
28
	protected $helper;
29
30
	/**
31
	 * Construct.
32
	 *
33
	 * @param CarbonHelper $helper Helper.
34
	 */
35
	public function __construct( CarbonHelper $helper ) {
36
		$this->helper = $helper;
37
	}
38
39
	/**
40
	 * Get.
41
	 *
42
	 * @param integer $id Id.
43
	 * @param string  $key Key.
44
	 * @param boolean $single Single.
45
	 * @return mixed
46
	 */
47
	public function get( int $id, string $key, bool $single = false ) {
48
		return $this->helper::get_term_meta( $id, $key );
1 ignored issue
show
Bug introduced by
Are you sure the usage of $this->helper::get_term_meta($id, $key) targeting Carbon_Fields\Helper\Helper::get_term_meta() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
49
	}
50
51
	/**
52
	 * Set.
53
	 *
54
	 * @param integer $id Id.
55
	 * @param string  $key Key.
56
	 * @param mixed   $value Value.
57
	 * @return IMeta
58
	 */
59
	public function set( int $id, string $key, $value ) : IMeta {
60
		$this->helper::set_term_meta( $id, $key, $value );
61
		return $this;
62
	}
63
}
64