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];
    }