public static function fromObject($object): self
    {
        $className = get_class($object);
        if (isset(self::$cache[$className])) {
            return self::$cache[$className];
        }

        self::$cache[$className] = new self(new \ReflectionObject($object));
        return self::$cache[$className];
    }
public static function fromObject($object): self
    {
        $className = get_class($object);
        if (isset(self::$cache[$className])) {
            return self::$cache[$className];
        }

        self::$cache[$className] = new self(new \ReflectionObject($object));
        return self::$cache[$className];
    }
public static function fromObject ( $ object ) : self { $ className = get_class ( $ object ) ; if ( isset ( self :: $ cache [ $ className ] ) ) { return self :: $ cache [ $ className ] ; } self :: $ cache [ $ className ] = new self ( new \ ReflectionObject ( $ object ) ) ; return self :: $ cache [ $ className ] ; }
creates the structure from given object

This method will cache the result - on the next request with the same
class it will return the same result, even if the given object is a
different instance.

@param   object  $object
@return  \stubbles\xml\serializer\AnnotationBasedObjectXmlSerializer
creates the structure from given object