Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
26 / 26 |
CRAP | |
100.00% |
38 / 38 |
| AbstractPage | |
100.00% |
1 / 1 |
|
100.00% |
26 / 26 |
26 | |
100.00% |
38 / 38 |
| lateConstruct | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| getName | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| setName | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| getPageTitle | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| setPageTitle | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| getMenuTitle | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| setMenuTitle | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| getCapability | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| setCapability | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| getMenuSlug | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| setMenuSlug | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| getView | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| setView | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| render | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| enqueueScriptStyles | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| getRequest | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| setRequest | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| getFormFactory | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| setFormFactory | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| getForm | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| setForm | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| getFormEntity | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| setFormEntity | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| getTabs | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| setTabs | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| handleRequest | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| <?php | |
| declare(strict_types=1); | |
| namespace Korobochkin\WPKit\Pages; | |
| use Korobochkin\WPKit\Pages\Tabs\TabsInterface; | |
| use Symfony\Component\Form\FormFactoryInterface; | |
| use Symfony\Component\Form\FormInterface; | |
| use Symfony\Component\HttpFoundation\Request; | |
| abstract class AbstractPage implements PageInterface | |
| { | |
| /** | |
| * @var string Page name. | |
| */ | |
| protected $name; | |
| /** | |
| * @var string Page title. | |
| */ | |
| protected $pageTitle; | |
| /** | |
| * @var string Page menu title. | |
| */ | |
| protected $menuTitle; | |
| /** | |
| * @var string Capability to access to the page. | |
| */ | |
| protected $capability; | |
| /** | |
| * @var string Page menu slug. | |
| */ | |
| protected $menuSlug; | |
| /** | |
| * @var Views\PageViewInterface Page view instance. | |
| */ | |
| protected $view; | |
| /** | |
| * @var Request Current HTTP request. | |
| */ | |
| protected $request; | |
| /** | |
| * @var FormFactoryInterface Form factory to building $form. | |
| */ | |
| protected $formFactory; | |
| /** | |
| * @var FormInterface HTML Form. | |
| */ | |
| protected $form; | |
| /** | |
| * @var object An object (instance) which holds the form data. | |
| */ | |
| protected $formEntity; | |
| /** | |
| * @var TabsInterface Tabs. | |
| */ | |
| protected $tabs; | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function lateConstruct() | |
| { | |
| return $this; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function getName() | |
| { | |
| return $this->name; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function setName($name) | |
| { | |
| $this->name = $name; | |
| return $this; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function getPageTitle() | |
| { | |
| return $this->pageTitle; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function setPageTitle($title) | |
| { | |
| $this->pageTitle = $title; | |
| return $this; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function getMenuTitle() | |
| { | |
| return $this->menuTitle; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function setMenuTitle($title) | |
| { | |
| $this->menuTitle = $title; | |
| return $this; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function getCapability() | |
| { | |
| return $this->capability; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function setCapability($cap) | |
| { | |
| $this->capability = $cap; | |
| return $this; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function getMenuSlug() | |
| { | |
| return $this->menuSlug; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function setMenuSlug($menuSlug) | |
| { | |
| $this->menuSlug = $menuSlug; | |
| return $this; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function getView() | |
| { | |
| return $this->view; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function setView(Views\PageViewInterface $view) | |
| { | |
| $this->view = $view; | |
| return $this; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function render() | |
| { | |
| $this->getView()->render($this); | |
| } | |
| /** | |
| * Method for enqueuing required JS and CSS files. | |
| */ | |
| public function enqueueScriptStyles() | |
| { | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function getRequest() | |
| { | |
| return $this->request; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function setRequest(Request $request) | |
| { | |
| $this->request = $request; | |
| return $this; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function getFormFactory() | |
| { | |
| return $this->formFactory; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function setFormFactory(FormFactoryInterface $formFactory) | |
| { | |
| $this->formFactory = $formFactory; | |
| return $this; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function getForm() | |
| { | |
| return $this->form; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function setForm(FormInterface $form) | |
| { | |
| $this->form = $form; | |
| return $this; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function getFormEntity() | |
| { | |
| return $this->formEntity; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function setFormEntity($formEntity) | |
| { | |
| $this->formEntity = $formEntity; | |
| return $this; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function getTabs() | |
| { | |
| return $this->tabs; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function setTabs(Tabs\TabsInterface $tabs) | |
| { | |
| $this->tabs = $tabs; | |
| return $this; | |
| } | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function handleRequest() | |
| { | |
| } | |
| } |