Пример #1
0
 public function getContent($dataSource)
 {
     if ($this->content instanceof \Closure) {
         $func = $this->content;
         return $func($dataSource);
     }
     Assertion::nullOrScalar($this->content);
     return $this->content;
 }
Пример #2
0
 /**
  * @return mixed
  */
 public function getAction()
 {
     if ($this->action instanceof \Closure) {
         $func = $this->action;
         return $func($this->dataSource);
     }
     Assertion::nullOrScalar($this->action);
     return $this->action;
 }
Пример #3
0
 /**
  * @return string
  */
 public function getUrl($dataSource)
 {
     $url = $this->url;
     if ($url instanceof \Closure) {
         return $url($dataSource);
     }
     Assertion::nullOrScalar($url);
     return $url;
 }
Пример #4
0
 /**
  * @return string
  */
 public function getLabel($dataSource, $label)
 {
     if ($this->label instanceof \Closure) {
         $label = $this->label;
         return $label($dataSource);
     }
     if (is_scalar($this->label)) {
         return $this->label;
     }
     Assertion::nullOrScalar($label);
     return $label;
 }
Пример #5
0
 public function __construct(Key $key, $lb, $li = false, $hb = null, $hi = false)
 {
     Assertion::nullOrScalar($lb);
     Assertion::boolean($li);
     Assertion::nullOrScalar($hb);
     Assertion::boolean($hi);
     $this->key = $key;
     $this->lower_bound = $lb;
     $this->lower_inclusive = $li;
     $this->higher_bound = $hb;
     $this->higher_inclusive = $hi;
 }