Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
10 / 10 |
CRAP | |
100.00% |
13 / 13 |
| AbstractPlugin | |
100.00% |
1 / 1 |
|
100.00% |
10 / 10 |
10 | |
100.00% |
13 / 13 |
| __construct | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| run | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| runAdmin | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| getFile | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| setFile | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| getContainer | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| setContainer | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| getDir | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| getUrl | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| getBasename | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| <?php | |
| declare(strict_types=1); | |
| namespace Korobochkin\WPKit\Plugins; | |
| use Symfony\Component\DependencyInjection\ContainerInterface; | |
| /** | |
| * Class AbstractPlugin | |
| * @package Korobochkin\WPKit\Plugins | |
| */ | |
| abstract class AbstractPlugin implements PluginInterface | |
| { | |
| /** | |
| * @var string A path to plugin bootstrap file. | |
| */ | |
| protected $file; | |
| /** | |
| * @var ContainerInterface | |
| */ | |
| protected $container; | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function __construct($file) | |
| { | |
| $this->setFile($file); | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function run() | |
| { | |
| return $this; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function runAdmin() | |
| { | |
| return $this; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function getFile() | |
| { | |
| return $this->file; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function setFile($file) | |
| { | |
| $this->file = $file; | |
| return $this; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function getContainer() | |
| { | |
| return $this->container; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function setContainer(ContainerInterface $container = null) | |
| { | |
| $this->container = $container; | |
| return $this; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function getDir() | |
| { | |
| return plugin_dir_path($this->getFile()); | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function getUrl() | |
| { | |
| return plugin_dir_url($this->getFile()); | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function getBasename() | |
| { | |
| return plugin_basename($this->getFile()); | |
| } | |
| } |