Your project must not contain invalid instantiations

More information: https://insight.symfony.com/what-we-analyse/php.invalid_instantiation

  1. $this->_xml->{$name}[$idx] = $value;
  2. foreach ($attributes as $attr => $v) {
  3. $this->_xml->{$name}[$idx][(string) $attr] = (string) $v;
  4. }
  5. $node = new self($this->_xml->$name);
    Parameter #1 $xml of class Errbit\Utils\XmlBuilder constructor expects SimpleXMLElement|null, mixed given.
    Last edited by Max Małecki
  6. if ($getLastChild) {
  7. $array = $this->_xml->xpath($name."[last()]");
  8. if (is_array($array)) {
  9. $xml = array_shift($array);
  10. if ($xml instanceof \SimpleXMLElement) {

Your project should not use invalid offsets

More information: https://insight.symfony.com/what-we-analyse/php.invalid_offset

  1. *
  2. * @return static the current builder
  3. */
  4. public function attribute(string $name, string $value): static
  5. {
  6. $this->_xml[$name] = $value;
    SimpleXMLElement does not accept string.
    Last edited by Max Małecki
  7. return $this;
  8. }
  9. /**