public static function createFrom(self $resolving = null, string $key): self
    {
        $instance = null === $resolving ? new self() : $resolving;
        if (false === $instance->has($key)) {
            $instance->add($key);
        }

        return $instance;
    }
public static function createFrom(self $resolving = null, string $key): self
    {
        $instance = null === $resolving ? new self() : $resolving;
        if (false === $instance->has($key)) {
            $instance->add($key);
        }

        return $instance;
    }
public static function createFrom ( self $ resolving = null , string $ key ) : self { $ instance = null === $ resolving ? new self ( ) : $ resolving ; if ( false === $ instance -> has ( $ key ) ) { $ instance -> add ( $ key ) ; } return $ instance ; }
Returns the existing instance if is an object or create a new one otherwise. It also ensure that the key will be
added also it won't increment the counter if already present.

@param self|null $resolving
Returns the existing instance if is an object or create a new one otherwise . It also ensure that the key will be added also it won t increment the counter if already present .