Currently, the MathML tree allows child elements to be null, string, MMLbase. This leads to frequent type checks and inconvenient branching in the code. This task aims to simplify the type model and make the tree handling cleaner and more maintainable.
We should decide on what to do with each problem
- Strings
Null
Instead of returning null we use an new MMLarray() object instead. A strict null check of $x should be converted to $x intanceof MMLarray && $x->isEmpty(). In situations where empty elements should be treated in the same way as null elements $x->isEmpty()$ is sufficient