Пример #1
0
 public function push($message, $type = Log::TYPE_MESSAGE)
 {
     if (is_array($message)) {
         $message_value = array_pop($message);
         $message_key = $message;
     } else {
         $message_value = $message;
         $message_key = null;
     }
     $this->storage->set($message_key, $message_value);
     return $this;
 }
Пример #2
0
 /**
  * @return static
  */
 public function branch()
 {
     $key = func_get_args();
     if (!$key) {
         return $this;
     }
     if (null === $this->branches) {
         $this->branches = new PhpVar();
     }
     if (!($mock = $this->branches->get($key))) {
         $mock = new static($this->storage);
         $mock->mode = $this->mode;
         $mock->isEmptyBranch = true;
         $mock->branchKey = array_merge($this->branchKey, $key);
         $this->branches->set($key, $mock);
     }
     return $mock;
 }