/** * @param Model\Service $service * @param string $format * @param boolean $runChecks * @return ViewModel\ViewModel */ protected function _getContentView(Model\Service $service, $format = self::HTML, $runChecks = true) { // Create and set view template $view = new ViewModel\ViewModel(); $view->setTemplate('format/' . $format); // Activate json encoder switch ($format) { case self::JSON: case self::XML: $runChecks = true; break; } /** * TODO change here runner with service model parameter */ $sites = $service->getSites(); $domains = $service->getDomains(); $boolean = new Filter\Boolean(Filter\Boolean::TYPE_FALSE_STRING); if ($boolean->filter($runChecks)) { $sites = Runner\Html::run($service->getSites()); } // Set view properties $view->service = $service; $view->sites = $sites; $view->domains = $domains; return $view; }
/** * Receive and process the contents of an annotation * * @param array $data */ public function __construct(array $data) { $continueIfEmpty = isset($data['value']) ? $data['value'] : false; if (!is_bool($continueIfEmpty)) { $filter = new BooleanFilter(); $continueIfEmpty = $filter->filter($continueIfEmpty); } $this->continueIfEmpty = $continueIfEmpty; }
/** * Receive and process the contents of an annotation * * @param array $data * @return void */ public function __construct(array $data) { if (!isset($data['value'])) { $data['value'] = false; } $required = $data['value']; if (!is_bool($required)) { $filter = new BooleanFilter(); $required = $filter->filter($required); } $this->required = $required; }
/** * Receive and process the contents of an annotation * * @param array $data */ public function __construct(array $data) { if (!isset($data['value'])) { $data['value'] = false; } $allowEmpty = $data['value']; if (!is_bool($allowEmpty)) { $filter = new BooleanFilter(); $allowEmpty = $filter->filter($allowEmpty); } $this->allowEmpty = $allowEmpty; }
/** * Receive and process the contents of an annotation * * @param string $content * @return void */ public function initialize($content) { $required = $content; if ('"' === substr($content, 0, 1)) { $required = $this->parseJsonContent($content, __METHOD__); } if (!is_bool($required)) { $filter = new BooleanFilter(); $required = $filter->filter($required); } $this->required = $required; }
public function testGettingDefaultType() { $filter = new BooleanFilter(); $this->assertEquals(127, $filter->getType()); }
/** * @param $defaultIsActive * @return \Application\Options\FileManagerOptions */ public function setDefaultIsActive($defaultIsActive) { $filter = new Filter\Boolean(Filter\Boolean::TYPE_ZERO_STRING); $this->defaultIsActive = $filter->filter($defaultIsActive); return $this; }