Do not use the PHP_SAPI constant here, it's not very readable and complex enough to be isolated into a spunQ function (like spunQ::getSapi() & spunQ::SAPI_CONSOLE).
We should use a state parttern here, this is just awful.
Managing type storages is incomplete. There should be a function that forces this type storage to make all necessary adaptions to be able to hold the data of the changed type.