public static function toArrayFrom($source, $firstLevel = false, $excludeClasses = [], $propertyPattern = null)
    {
        // Prepare the source object type
        $object = new SerializerObject($source);
        $object->setStopFirstLevel($firstLevel);
        $object->setDoNotParse($excludeClasses);
        if (!is_null($propertyPattern)) {
            if (!is_array($propertyPattern)) {
                throw new InvalidArgumentException(
                    'Property pattern must be an array with 2 regex elements (Search and Replace)'
                );
            }
            $object->setMethodPattern($propertyPattern[0], $propertyPattern[1]);
        }
        return $object->build();
    }