Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
4 / 4 |
DeleteTrait | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
4 / 4 |
delete | |
100.00% |
1 / 1 |
2 | |
100.00% |
4 / 4 |
<?php | |
declare(strict_types=1); | |
namespace Korobochkin\WPKit\DataComponents\Traits; | |
trait DeleteTrait | |
{ | |
/** | |
* @inheritdoc | |
*/ | |
public function delete() | |
{ | |
/** | |
* @var $this \Korobochkin\WPKit\Options\OptionInterface|\Korobochkin\WPKit\Transients\TransientInterface | |
*/ | |
$result = $this->deleteFromWP(); | |
if ($result) { | |
$this->setLocalValue(null); | |
} | |
return $result; | |
} | |
} |