Well, it's basically a set of classes all under a common namespace, and in the use of it, the constructors will be called A LOT. as such, simply allowing a way to remove the new keyword will save a substantial amount of time, effort, and coding space.
This is how it would look as is:
$i = new base_one(
new base_one(
new base_two(
new base_three($a),
$b
)
),
new base_one(
new base_two(
new base_three($c),
$d
),
new base_two(
new base_three($e),
$f
),
new base_two(
new base_three($g),
$h
),
)
);
And this is along the lines of how I would like to clean it up:
$i = base::one(
base::one(
base::two(
base::three($a),
$b
)
),
base::one(
base::two(
base::three($c),
$d
),
base::two(
base::three($e),
$f
),
base::two(
base::three($g),
$h
),
)
);
After you pointed me to magic functions, I found __call(), but it seems that doesn't work with static methods, so I may use them all as non-static public methods of an instantiated base class object:
$i = $o->one(
$o->one(
$o->two(
$o->three($a),
$b
)
),
$o->one(
$o->two(
$o->three($c),
$d
),
$o->two(
$o->three($e),
$f
),
$o->two(
$o->three($g),
$h
),
)
);
I think this will work pretty well afterall. Thanks 🙂