for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Carbon Term.
*
* @package App
*/
declare(strict_types=1);
namespace App\Services\Meta;
use Carbon_Fields\Helper\Helper as CarbonHelper;
use WPSteak\Services\Meta\IMeta;
use WPSteak\Services\Meta\TermInterface;
* Carbon Term class.
* @codeCoverageIgnore
class CarbonTerm implements TermInterface {
* Helper.
* @var CarbonHelper
protected $helper;
* Construct.
* @param CarbonHelper $helper Helper.
public function __construct( CarbonHelper $helper ) {
$this->helper = $helper;
}
* Get.
* @param integer $id Id.
* @param string $key Key.
* @param boolean $single Single.
* @return mixed
public function get( int $id, string $key, bool $single = false ) {
return $this->helper::get_term_meta( $id, $key );
$this->helper::get_term_meta($id, $key)
Carbon_Fields\Helper\Helper::get_term_meta()
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.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
* Set.
* @param mixed $value Value.
* @return IMeta
public function set( int $id, string $key, $value ) : IMeta {
$this->helper::set_term_meta( $id, $key, $value );
return $this;
This check looks for function or method calls that always return null and whose return value is used.
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.