Beispiel #1
0
 /**
  * 2016-07-10
  * @return array(string => string)
  */
 public function asArray()
 {
     return dfc($this, function () {
         return df_map_k(function ($key, $value) {
             return $this->formatKV($key, $value);
         }, $this->primary() + ['Request URL' => $this->response()->requestUrl(), 'Request params' => df_tab_multiline(df_print_params($this->response()->requestP())), 'Response' => df_tab_multiline(df_print_params($this->response()->getData()))]);
     });
 }
Beispiel #2
0
 /** @return string */
 private function content()
 {
     return dfc($this, function () {
         /** @var string $content */
         $content = df_trim($this[self::$P__CONTENT], "\n");
         return $this->tagIs('pre', 'code') || !df_contains($content, "\n") ? $content : "\n" . df_tab_multiline($content) . "\n";
     });
 }
Beispiel #3
0
 /**
  * 2015-12-16
  * @return string
  */
 public function render()
 {
     return df_cc_n(df_map_k($this->_blocks, function ($selector, array $rules) {
         /** @var string $selector */
         /** @var string[] $rules */
         /** @var string $rulesS */
         $rulesS = df_tab_multiline(df_cc_n($rules));
         return "{$selector} {\n{$rulesS}\n}";
     }));
 }
Beispiel #4
0
 /**
  * @param object $object
  * @return string
  */
 private function dumpObject($object)
 {
     /** @var string $hash */
     $hash = spl_object_hash($object);
     /** @var string $result */
     if (isset($this->_dumped[$hash])) {
         $result = sprintf('[рекурсия: %s]', get_class($object));
     } else {
         $this->_dumped[$hash] = true;
         $result = !$object instanceof \Magento\Framework\DataObject ? get_class($object) : sprintf("%s(%s\n)", get_class($object), df_tab_multiline($this->dumpArrayElements($object->getData())));
     }
     return $result;
 }
Beispiel #5
0
 /**
  * @param string[] $tags
  * @return string
  */
 private function implodeTags(array $tags)
 {
     return df_tab_multiline(df_cc_n($tags));
 }