@@ 939-948 (lines=10) @@ | ||
936 | return []; |
|
937 | } |
|
938 | ||
939 | protected function insertStringString($parent, $k, $v, $fn) |
|
940 | { |
|
941 | // The user has passed an element name and an element value: |
|
942 | // [ 'element' => 'Element content' ] |
|
943 | ||
944 | $el = $this->createElement($k, $v); |
|
945 | $el = $fn($parent, $el); |
|
946 | ||
947 | return [ $el ]; |
|
948 | } |
|
949 | ||
950 | protected function insertStringMixed($parent, $k, $v, $fn, &$optionals) |
|
951 | { |
|
@@ 950-964 (lines=15) @@ | ||
947 | return [ $el ]; |
|
948 | } |
|
949 | ||
950 | protected function insertStringMixed($parent, $k, $v, $fn, &$optionals) |
|
951 | { |
|
952 | // The user has passed one of these two cases: |
|
953 | // - [ 'element' => [...] ] |
|
954 | // - [ 'element' => DOMNode|SimpleXMLElement|FluidXml ] |
|
955 | ||
956 | $el = $this->createElement($k); |
|
957 | $el = $fn($parent, $el); |
|
958 | ||
959 | // The new children elements must be created in the order |
|
960 | // they are supplied, so 'appendChild' is the perfect operation. |
|
961 | $this->newContext($el)->appendChild($v, ...$optionals); |
|
962 | ||
963 | return [ $el ]; |
|
964 | } |
|
965 | ||
966 | protected function insertIntegerArray($parent, $k, $v, $fn, &$optionals) |
|
967 | { |