Altered $geometry->getComponents

I made an altered version of getComponents that behaves in the normal manner if no parameters are provided, but has the option of specifying a geometry type or an array of geometry types and it will then recursively break down the geometry until all components comprise of the types provided.

The use case I made this for was primarily to break down a complex geometry collection into points, lines, and polygons with a single function call.

ie:
$geometry->getComponents(array('Point', 'LineString', 'Polygon'));