Exemplo n.º 1
0
 /**
  * 2016-08-27
  * @param object $caller
  * @param array(string => mixed) $p
  * @return string
  */
 private static function _sign($caller, array $p)
 {
     /** @var string $type */
     $type = df_trim_text_left(df_caller_f(), 'sign');
     /** @var self $i */
     $i = df_create(df_con($caller, df_cc_class('Signer', $type), df_con($caller, 'Signer')), $p);
     $i->_caller = $caller;
     return $i->sign();
 }
Exemplo n.º 2
0
 /**
  * 2015-12-16
  * @return Size
  */
 private function _size()
 {
     /** @var string $key */
     $key = df_caller_f();
     if (!isset($this->{__METHOD__}[$key])) {
         $this->{__METHOD__}[$key] = new Size($this[$key]);
     }
     return $this->{__METHOD__}[$key];
 }
Exemplo n.º 3
0
 /**
  * 2016-11-12
  * @param string|null $key [optional]
  * @param null|string|int|S|Store $s [optional]
  * @param mixed|callable $default [optional]
  * @uses p()
  * @return mixed
  */
 protected function testableP($key = null, $s = null, $default = null)
 {
     return $this->testableGeneric($key ?: df_caller_f(), 'p', $s, $default);
 }
Exemplo n.º 4
0
 /**
  * 2016-09-06
  * @used-by \Df\Payment\Method::cFromBase()
  * @used-by \Df\Payment\Method::cFromOrder()
  * @used-by \Df\Payment\Method::cToBase()
  * @used-by \Df\Payment\Method::cToOrder()
  * @param float $amount
  * @return float
  */
 private function convert($amount)
 {
     return call_user_func([$this->s(), df_caller_f()], $amount, $this->o());
 }
Exemplo n.º 5
0
 /**
  * 2016-07-18
  * @param string|null $key [optional]
  * @return Response|string|null
  */
 private function response($key = null)
 {
     /** @var string $f */
     $f = dfa(['L' => 'df_last', 'F' => 'df_first'], substr(df_caller_f(), -1));
     if (!isset($this->{__METHOD__}[$f])) {
         $this->{__METHOD__}[$f] = df_n_set(call_user_func($f, $this->responses()));
     }
     /** @var Response|null $r */
     $r = df_n_get($this->{__METHOD__}[$f]);
     return !$r || is_null($key) ? $r : $r[$key];
 }
Exemplo n.º 6
0
 /**
  * 2015-12-16
  * @param string|null $key [optional]
  * @param null|string|int|S|Store $s [optional]
  * @return mixed[]
  */
 private function json($key = null, $s = null)
 {
     return df_nta(@df_json_decode($this->v($key ?: df_caller_f(), $s)));
 }
Exemplo n.º 7
0
Arquivo: O.php Projeto: mage2pro/core
 /**
  * 2016-08-10
  * @param callable $f
  * @param mixed|null $d [optional]
  * @param string|null $key [optional]
  * @return mixed
  */
 private function filter(callable $f, $d = null, $key = null)
 {
     return dfc($this, function ($f, $d, $key) {
         return call_user_func($f, $this->v($d, $key));
     }, [$f, $d, $key ?: df_caller_f(1)]);
 }
Exemplo n.º 8
0
 /**
  * 2016-08-27
  * @param string|null $key [optional]
  * @return mixed
  */
 private function cv($key = null)
 {
     return $this[$this->c($key ?: df_caller_f())];
 }