/** * Build a response object * * @param \GuzzleHttp\Psr7\Response $response * @return Activity[] */ public function map(Response $response) { // Pares XML $reader = new Reader(); $reader->xml($response->getBody()); $parse = $reader->parse(); $return = []; foreach ($parse['value'] as $value) { $return[] = new Activity($value['attributes'], $value['value']); } return $return; }
/** * The deserialize method is called during xml parsing. * * This method is called statictly, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are * free to return other data as well. * * You are responsible for advancing the reader to the next element. Not * doing anything will result in a never-ending loop. * * If you just want to skip parsing for this element altogether, you can * just call $reader->next(); * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. * * @param Reader $reader * @return mixed */ static function xmlDeserialize(Reader $reader) { $elems = $reader->parseInnerTree(); $obj = new self(); $obj->properties = self::traverse($elems); return $obj; }
/** * The deserialize method is called during xml parsing. * * This method is called statictly, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are * free to return other data as well. * * You are responsible for advancing the reader to the next element. Not * doing anything will result in a never-ending loop. * * If you just want to skip parsing for this element altogether, you can * just call $reader->next(); * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. * * @param Reader $reader * @return mixed */ static function xmlDeserialize(Reader $reader) { $self = new self(); $reader->pushContext(); $reader->elementMap['{DAV:}prop'] = 'Sabre\\Xml\\Element\\Elements'; $elems = KeyValue::xmlDeserialize($reader); $reader->popContext(); $required = ['{DAV:}sync-token', '{DAV:}prop']; foreach ($required as $elem) { if (!array_key_exists($elem, $elems)) { throw new BadRequest('The ' . $elem . ' element in the {DAV:}sync-collection report is required'); } } $self->properties = $elems['{DAV:}prop']; $self->syncToken = $elems['{DAV:}sync-token']; if (isset($elems['{DAV:}limit'])) { $nresults = null; foreach ($elems['{DAV:}limit'] as $child) { if ($child['name'] === '{DAV:}nresults') { $nresults = (int) $child['value']; } } $self->limit = $nresults; } if (isset($elems['{DAV:}sync-level'])) { $value = $elems['{DAV:}sync-level']; if ($value === 'infinity') { $value = \Sabre\DAV\Server::DEPTH_INFINITY; } $self->syncLevel = $value; } return $self; }
/** * The deserialize method is called during xml parsing. * * This method is called statictly, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are * free to return other data as well. * * You are responsible for advancing the reader to the next element. Not * doing anything will result in a never-ending loop. * * If you just want to skip parsing for this element altogether, you can * just call $reader->next(); * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. * * @param Reader $reader * @return mixed */ static function xmlDeserialize(Reader $reader) { $result = ['name' => null, 'is-not-defined' => false, 'param-filters' => [], 'text-match' => null, 'time-range' => false]; $att = $reader->parseAttributes(); $result['name'] = $att['name']; $elems = $reader->parseInnerTree(); if (is_array($elems)) { foreach ($elems as $elem) { switch ($elem['name']) { case '{' . Plugin::NS_CALDAV . '}param-filter': $result['param-filters'][] = $elem['value']; break; case '{' . Plugin::NS_CALDAV . '}is-not-defined': $result['is-not-defined'] = true; break; case '{' . Plugin::NS_CALDAV . '}time-range': $result['time-range'] = ['start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null, 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null]; if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) { throw new BadRequest('The end-date must be larger than the start-date'); } break; case '{' . Plugin::NS_CALDAV . '}text-match': $result['text-match'] = ['negate-condition' => isset($elem['attributes']['negate-condition']) && $elem['attributes']['negate-condition'] === 'yes', 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap', 'value' => $elem['value']]; break; } } } return $result; }
/** * The deserialize method is called during xml parsing. * * This method is called statictly, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are * free to return other data as well. * * You are responsible for advancing the reader to the next element. Not * doing anything will result in a never-ending loop. * * If you just want to skip parsing for this element altogether, you can * just call $reader->next(); * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. * * @param Reader $reader * @return mixed */ static function xmlDeserialize(Reader $reader) { $result = ['name' => null, 'test' => 'anyof', 'is-not-defined' => false, 'param-filters' => [], 'text-matches' => []]; $att = $reader->parseAttributes(); $result['name'] = $att['name']; if (isset($att['test']) && $att['test'] === 'allof') { $result['test'] = 'allof'; } $elems = $reader->parseInnerTree(); if (is_array($elems)) { foreach ($elems as $elem) { switch ($elem['name']) { case '{' . Plugin::NS_CARDDAV . '}param-filter': $result['param-filters'][] = $elem['value']; break; case '{' . Plugin::NS_CARDDAV . '}is-not-defined': $result['is-not-defined'] = true; break; case '{' . Plugin::NS_CARDDAV . '}text-match': $matchType = isset($elem['attributes']['match-type']) ? $elem['attributes']['match-type'] : 'contains'; if (!in_array($matchType, ['contains', 'equals', 'starts-with', 'ends-with'])) { throw new BadRequest('Unknown match-type: ' . $matchType); } $result['text-matches'][] = ['negate-condition' => isset($elem['attributes']['negate-condition']) && $elem['attributes']['negate-condition'] === 'yes', 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;unicode-casemap', 'value' => $elem['value'], 'match-type' => $matchType]; break; } } } return $result; }
/** * The deserialize method is called during xml parsing. * * This method is called statictly, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are * free to return other data as well. * * You are responsible for advancing the reader to the next element. Not * doing anything will result in a never-ending loop. * * If you just want to skip parsing for this element altogether, you can * just call $reader->next(); * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. * * @param Reader $reader * @return mixed */ static function xmlDeserialize(Reader $reader) { $timeRange = '{' . Plugin::NS_CALDAV . '}time-range'; $start = null; $end = null; foreach ((array) $reader->parseInnerTree([]) as $elem) { if ($elem['name'] !== $timeRange) { continue; } $start = empty($elem['attributes']['start']) ?: $elem['attributes']['start']; $end = empty($elem['attributes']['end']) ?: $elem['attributes']['end']; } if (!$start && !$end) { throw new BadRequest('The freebusy report must have a time-range element'); } if ($start) { $start = DateTimeParser::parseDateTime($start); } if ($end) { $end = DateTimeParser::parseDateTime($end); } $result = new self(); $result->start = $start; $result->end = $end; return $result; }
function parse($xml, array $elementMap = []) { $reader = new Reader(); $reader->elementMap = array_merge($this->elementMap, $elementMap); $reader->xml($xml); return $reader->parse(); }
function testDeserialize() { $input = <<<BLA <?xml version="1.0"?> <root xmlns="http://sabredav.org/ns"> <listThingy> <elem1 /> <elem2 /> <elem3 /> <elem4 attr="val" /> <elem5>content</elem5> <elem6><subnode /></elem6> </listThingy> <listThingy /> <otherThing> <elem1 /> <elem2 /> <elem3 /> </otherThing> </root> BLA; $reader = new Reader(); $reader->elementMap = ['{http://sabredav.org/ns}listThingy' => 'Sabre\\Xml\\Element\\Elements']; $reader->xml($input); $output = $reader->parse(); $this->assertEquals(['name' => '{http://sabredav.org/ns}root', 'value' => [['name' => '{http://sabredav.org/ns}listThingy', 'value' => ['{http://sabredav.org/ns}elem1', '{http://sabredav.org/ns}elem2', '{http://sabredav.org/ns}elem3', '{http://sabredav.org/ns}elem4', '{http://sabredav.org/ns}elem5', '{http://sabredav.org/ns}elem6'], 'attributes' => []], ['name' => '{http://sabredav.org/ns}listThingy', 'value' => [], 'attributes' => []], ['name' => '{http://sabredav.org/ns}otherThing', 'value' => [['name' => '{http://sabredav.org/ns}elem1', 'value' => null, 'attributes' => []], ['name' => '{http://sabredav.org/ns}elem2', 'value' => null, 'attributes' => []], ['name' => '{http://sabredav.org/ns}elem3', 'value' => null, 'attributes' => []]], 'attributes' => []]], 'attributes' => []], $output); }
/** * The deserialize method is called during xml parsing. * * This method is called statictly, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are * free to return other data as well. * * You are responsible for advancing the reader to the next element. Not * doing anything will result in a never-ending loop. * * If you just want to skip parsing for this element altogether, you can * just call $reader->next(); * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. * * @param Reader $reader * @return mixed */ static function xmlDeserialize(Reader $reader) { $result = ['name' => null, 'is-not-defined' => false, 'comp-filters' => [], 'prop-filters' => [], 'time-range' => false]; $att = $reader->parseAttributes(); $result['name'] = $att['name']; $elems = $reader->parseInnerTree(); if (is_array($elems)) { foreach ($elems as $elem) { switch ($elem['name']) { case '{' . Plugin::NS_CALDAV . '}comp-filter': $result['comp-filters'][] = $elem['value']; break; case '{' . Plugin::NS_CALDAV . '}prop-filter': $result['prop-filters'][] = $elem['value']; break; case '{' . Plugin::NS_CALDAV . '}is-not-defined': $result['is-not-defined'] = true; break; case '{' . Plugin::NS_CALDAV . '}time-range': if ($result['name'] === 'VCALENDAR') { throw new BadRequest('You cannot add time-range filters on the VCALENDAR component'); } $result['time-range'] = ['start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null, 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null]; if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) { throw new BadRequest('The end-date must be larger than the start-date'); } break; } } } return $result; }
public function read($path) { parent::read($path); $reader = new Reader(); $reader->xml($this->contents); $this->parsed = $reader->parse(); return $this; }
function parse($xml) { $reader = new Reader(); $reader->elementMap['{DAV:}root'] = 'Sabre\\DAVACL\\Xml\\Property\\CurrentUserPrivilegeSet'; $reader->xml($xml); $result = $reader->parse(); return $result['value']; }
public function testParseReturnsArray() { $rw = new Realworks(); $xmlString = file_get_contents('example.xml'); $reader = new XML\Reader(); $reader->xml($xmlString); $output = $reader->parse(); $objects = $rw->parse($output); $this->assertInternalType('array', $objects); }
/** * The deserialize method is called during xml parsing. * * This method is called statictly, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are * free to return other data as well. * * You are responsible for advancing the reader to the next element. Not * doing anything will result in a never-ending loop. * * If you just want to skip parsing for this element altogether, you can * just call $reader->next(); * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. * * @param Reader $reader * @return mixed */ static function xmlDeserialize(Reader $reader) { if (!$reader->isEmptyElement) { throw new BadRequest('The {DAV:}principal-search-property-set element must be empty'); } // The element is actually empty, so there's not much to do. $reader->next(); $self = new self(); return $self; }
/** * The deserialize method is called during xml parsing. * * This method is called statictly, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are * free to return other data as well. * * You are responsible for advancing the reader to the next element. Not * doing anything will result in a never-ending loop. * * If you just want to skip parsing for this element altogether, you can * just call $reader->next(); * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. * * @param Reader $reader * @return mixed */ static function xmlDeserialize(Reader $reader) { $tags = []; foreach ($reader->parseInnerTree() as $elem) { if ($elem['name'] === '{' . self::NS_OWNCLOUD . '}tag') { $tags[] = $elem['value']; } } return new self($tags); }
/** * The deserialize method is called during xml parsing. * * @param Reader $reader * @return mixed */ static function xmlDeserialize(Reader $reader) { $shareTypes = []; foreach ($reader->parseInnerTree() as $elem) { if ($elem['name'] === '{' . self::NS_OWNCLOUD . '}share-type') { $shareTypes[] = (int) $elem['value']; } } return new self($shareTypes); }
/** * The deserialize method is called during xml parsing. * * This method is called statictly, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are * free to return other data as well. * * You are responsible for advancing the reader to the next element. Not * doing anything will result in a never-ending loop. * * If you just want to skip parsing for this element altogether, you can * just call $reader->next(); * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. * * @param Reader $reader * @return mixed */ static function xmlDeserialize(Reader $reader) { $reader->pushContext(); $reader->elementMap['{DAV:}prop'] = 'Sabre\\Xml\\Deserializer\\enum'; $elems = Deserializer\keyValue($reader, 'DAV:'); $reader->popContext(); $report = new self(); if (!empty($elems['prop'])) { $report->properties = $elems['prop']; } return $report; }
/** * The deserialize method is called during xml parsing. * * This method is called statictly, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are * free to return other data as well. * * Important note 2: You are responsible for advancing the reader to the * next element. Not doing anything will result in a never-ending loop. * * If you just want to skip parsing for this element altogether, you can * just call $reader->next(); * * $reader->parseSubTree() will parse the entire sub-tree, and advance to * the next element. * * @param XML\Reader $reader * @return mixed */ public static function deserializeXml(XML\Reader $reader) { $reader->next(); $count = 1; while ($count) { $reader->read(); if ($reader->nodeType === $reader::END_ELEMENT) { $count--; } } $reader->read(); }
/** * The deserialize method is called during xml parsing. * * This method is called statictly, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are * free to return other data as well. * * Important note 2: You are responsible for advancing the reader to the * next element. Not doing anything will result in a never-ending loop. * * If you just want to skip parsing for this element altogether, you can * just call $reader->next(); * * $reader->parseSubTree() will parse the entire sub-tree, and advance to * the next element. * * @param Xml\Reader $reader * @return mixed */ static function xmlDeserialize(Xml\Reader $reader) { $reader->next(); $count = 1; while ($count) { $reader->read(); if ($reader->nodeType === $reader::END_ELEMENT) { $count--; } } $reader->read(); }
/** * The deserialize method is called during xml parsing. * * This method is called statictly, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are * free to return other data as well. * * You are responsible for advancing the reader to the next element. Not * doing anything will result in a never-ending loop. * * If you just want to skip parsing for this element altogether, you can * just call $reader->next(); * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. * * @param Reader $reader * @return mixed */ static function xmlDeserialize(Reader $reader) { $elems = $reader->parseInnerTree(['{DAV:}sharee' => 'Sabre\\DAV\\Xml\\Element\\Sharee', '{DAV:}share-access' => 'Sabre\\DAV\\Xml\\Property\\ShareAccess', '{DAV:}prop' => 'Sabre\\Xml\\Deserializer\\keyValue']); $sharees = []; foreach ($elems as $elem) { if ($elem['name'] !== '{DAV:}sharee') { continue; } $sharees[] = $elem['value']; } return new self($sharees); }
protected function read($xmlFile) { $xml_contents = file_get_contents($xmlFile); $reader = new Reader(); $reader->xml($xml_contents); $tree = $reader->parse(); foreach ($tree['value'] as $node) { $key = $node['attributes']['name']; $value = $node['value']; $this->patterns[$key] = $value; } }
/** * @expectedException \LogicException */ function testDeserialize() { $input = <<<BLA <?xml version="1.0"?> <root xmlns="http://sabredav.org/ns"> <blabla /> </root> BLA; $reader = new Reader(); $reader->elementMap = ['{http://sabredav.org/ns}blabla' => 'Sabre\\Xml\\Element\\Cdata']; $reader->xml($input); $output = $reader->parse(); }
/** * @dataProvider xmlProvider */ function testDeserialize($input, $expected) { $input = <<<BLA <?xml version="1.0"?> <root xmlns="http://sabredav.org/ns"> <fragment>{$input}</fragment> </root> BLA; $reader = new Reader(); $reader->elementMap = ['{http://sabredav.org/ns}fragment' => 'Sabre\\Xml\\Element\\XmlFragment']; $reader->xml($input); $output = $reader->parse(); $this->assertEquals(['name' => '{http://sabredav.org/ns}root', 'value' => [['name' => '{http://sabredav.org/ns}fragment', 'value' => new XmlFragment($expected), 'attributes' => []]], 'attributes' => []], $output); }
/** * The deserialize method is called during xml parsing. * * This method is called statictly, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are * free to return other data as well. * * You are responsible for advancing the reader to the next element. Not * doing anything will result in a never-ending loop. * * If you just want to skip parsing for this element altogether, you can * just call $reader->next(); * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. * * @param Reader $reader * @return mixed */ static function xmlDeserialize(Reader $reader) { $self = new self(); $elementMap = $reader->elementMap; $elementMap['{DAV:}prop'] = 'Sabre\\DAV\\Xml\\Element\\Prop'; $elementMap['{DAV:}set'] = 'Sabre\\Xml\\Element\\KeyValue'; $elems = $reader->parseInnerTree($elementMap); foreach ($elems as $elem) { if ($elem['name'] === '{DAV:}set') { $self->properties = array_merge($self->properties, $elem['value']['{DAV:}prop']); } } return $self; }
function testDeserialize() { $input = <<<BLA <?xml version="1.0"?> <root xmlns="http://sabredav.org/ns"> <uri>/foo/bar</uri> </root> BLA; $reader = new Reader(); $reader->contextUri = 'http://example.org/'; $reader->elementMap = ['{http://sabredav.org/ns}uri' => 'Sabre\\Xml\\Element\\Uri']; $reader->xml($input); $output = $reader->parse(); $this->assertEquals(['name' => '{http://sabredav.org/ns}root', 'value' => [['name' => '{http://sabredav.org/ns}uri', 'value' => new Uri('http://example.org/foo/bar'), 'attributes' => []]], 'attributes' => []], $output); }
/** * This function behaves similar to Sabre\Xml\Reader::parseCurrentElement, * but instead of creating deep xml array structures, it will turn any * top-level element it doesn't recognize into either a string, or an * XmlFragment class. * * This method returns arn array with 2 properties: * * name - A clark-notation XML element name. * * value - The parsed value. * * @return array */ private static function parseCurrentElement(Reader $reader) { $name = $reader->getClark(); if (array_key_exists($name, $reader->elementMap)) { $deserializer = $reader->elementMap[$name]; if (is_subclass_of($deserializer, 'Sabre\\Xml\\XmlDeserializable')) { $value = call_user_func([ $deserializer, 'xmlDeserialize' ], $reader); } elseif (is_callable($deserializer)) { $value = call_user_func($deserializer, $reader); } else { $type = gettype($deserializer); if ($type === 'string') { $type .= ' (' . $deserializer . ')'; } elseif ($type === 'object') { $type .= ' (' . get_class($deserializer) . ')'; } throw new \LogicException('Could not use this type as a deserializer: ' . $type); } } else { $value = Complex::xmlDeserialize($reader); } return [ 'name' => $name, 'value' => $value, ]; }
/** * The deserialize method is called during xml parsing. * * This method is called statictly, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are * free to return other data as well. * * You are responsible for advancing the reader to the next element. Not * doing anything will result in a never-ending loop. * * If you just want to skip parsing for this element altogether, you can * just call $reader->next(); * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. * * @param Reader $reader * @return mixed */ static function xmlDeserialize(Reader $reader) { $self = new self(); $elementMap = $reader->elementMap; $elementMap['{DAV:}prop'] = 'Sabre\DAV\Xml\Element\Prop'; $elementMap['{DAV:}set'] = 'Sabre\Xml\Element\KeyValue'; $elementMap['{DAV:}remove'] = 'Sabre\Xml\Element\KeyValue'; $elems = $reader->parseInnerTree($elementMap); foreach ($elems as $elem) { if ($elem['name'] === '{DAV:}set') { $self->properties = array_merge($self->properties, $elem['value']['{DAV:}prop']); } if ($elem['name'] === '{DAV:}remove') { // Ensuring there are no values. foreach ($elem['value']['{DAV:}prop'] as $remove => $value) { $self->properties[$remove] = null; } } } return $self; }
/** * * Component loading and tree construction. * */ public static function xmlDeserialize(Reader $reader) { $class_name = get_called_class(); $component = new $class_name(); /* First settings. */ $component->_nodename = 'views'; /* Iterate through children. */ $children = $reader->parseInnerTree(); if (!is_array($children)) { return $component; } foreach ($children as $child) { $component->_value[] = self::rec_xmlDeserialize($child, $component); } return $component; }
function testDeserializeValueObjectEmpty() { $input = <<<XML <?xml version="1.0"?> <foo xmlns="urn:foo" /> XML; $reader = new Reader(); $reader->xml($input); $reader->elementMap = ['{urn:foo}foo' => function (Reader $reader) { return valueObject($reader, 'Sabre\\Xml\\Deserializer\\TestVo', 'urn:foo'); }]; $output = $reader->parse(); $vo = new TestVo(); $expected = ['name' => '{urn:foo}foo', 'value' => $vo, 'attributes' => []]; $this->assertEquals($expected, $output); }
/** * The deserialize method is called during xml parsing. * * This method is called statictly, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are * free to return other data as well. * * You are responsible for advancing the reader to the next element. Not * doing anything will result in a never-ending loop. * * If you just want to skip parsing for this element altogether, you can * just call $reader->next(); * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. * * @param Reader $reader * @return mixed */ static function xmlDeserialize(Reader $reader) { $self = new self(); $reader->pushContext(); $reader->elementMap['{DAV:}prop'] = 'Sabre\\Xml\\Element\\Elements'; foreach (KeyValue::xmlDeserialize($reader) as $k => $v) { switch ($k) { case '{DAV:}prop': $self->properties = $v; break; case '{DAV:}allprop': $self->allProp = true; } } $reader->popContext(); return $self; }
/** * @inheritdoc */ protected function addIssuesFromXml(Reader $xml) { $xmlArray = $xml->parse(); foreach ((array) $xmlArray['value'] as $fileTag) { if ($fileTag['name'] != '{}file') { continue; } $fileName = $fileTag['attributes']['name']; foreach ((array) $fileTag['value'] as $issueTag) { $line = $issueTag['attributes']['beginline']; $tool = 'PHPMessDetector'; $type = $issueTag['attributes']['rule']; $message = $issueTag['value']; $this->result->addIssue($fileName, $line, $tool, $type, $message); } } }