| @@ 1918-1928 (lines=11) @@ | ||
| 1915 | protected static function mergeNode(\SimpleXMLElement $source, \SimpleXMLElement $new) |
|
| 1916 | { |
|
| 1917 | // Update the attributes of the child node. |
|
| 1918 | foreach ($new->attributes() as $name => $value) |
|
| 1919 | { |
|
| 1920 | if (isset($source[$name])) |
|
| 1921 | { |
|
| 1922 | $source[$name] = (string) $value; |
|
| 1923 | } |
|
| 1924 | else |
|
| 1925 | { |
|
| 1926 | $source->addAttribute($name, $value); |
|
| 1927 | } |
|
| 1928 | } |
|
| 1929 | } |
|
| 1930 | ||
| 1931 | /** |
|
| @@ 1947-1957 (lines=11) @@ | ||
| 1944 | // So we just have to scan the children and deal with them. |
|
| 1945 | ||
| 1946 | // Update the attributes of the child node. |
|
| 1947 | foreach ($new->attributes() as $name => $value) |
|
| 1948 | { |
|
| 1949 | if (isset($source[$name])) |
|
| 1950 | { |
|
| 1951 | $source[$name] = (string) $value; |
|
| 1952 | } |
|
| 1953 | else |
|
| 1954 | { |
|
| 1955 | $source->addAttribute($name, $value); |
|
| 1956 | } |
|
| 1957 | } |
|
| 1958 | ||
| 1959 | foreach ($new->children() as $child) |
|
| 1960 | { |
|