Ejemplo n.º 1
0
 /**
  * Parse all the data into the markup of slack.
  *
  * @param array $traceItem
  *
  * @return string
  */
 private function parseTraceItem(array $traceItem)
 {
     $text = '';
     $info = ['file' => $this->getArrayValue($traceItem, 'file', 'unknown'), 'function' => $this->getArrayValue($traceItem, 'function', 'unknown'), 'line' => $this->getArrayValue($traceItem, 'line', 'unknown'), 'class' => $this->getArrayValue($traceItem, 'class', 'unknown'), 'type' => $this->getArrayValue($traceItem, 'type', 'unknown')];
     $text .= $this->formatter->arrayToKeyValueList($info);
     return "\n" . $this->formatter->indent($text);
 }
 public function testIndent()
 {
     $stringFormat = new StringFormat();
     $this->assertEquals('>I am indented', $stringFormat->indent('I am indented'));
     $this->assertEquals(">I am indented\n>And the next line too", $stringFormat->indent("I am indented\nAnd the next line too"));
 }
 /**
  * @param array $parameter
  *
  * @return string
  */
 private function parseArrayParameter(array $parameter)
 {
     return "\n" . $this->formatter->arrayToKeyValueList(array_map(function ($item) {
         return print_r($item, true);
     }, $parameter));
 }