container->when( Expiration::class ) ->needs( '$seconds' ) ->give( static fn( $c ): int => $c->get( Config::class )->get( 'page_cache.expiration' ) ); $this->container->when( WP_Context::class ) ->needs( '$post_id' ) ->give( static fn(): int => (int) get_the_ID() ); $this->container->when( Collection::class ) ->needs( '$compressors' ) ->give( static fn( $c ): array => [ // Different browser compression algorithms for saving and serving cached files. $c->get( Brotli::class ), $c->get( Zstd::class ), $c->get( Gzip::class ), $c->get( Deflate::class ), $c->get( Html::class ), ] ); $this->container->singleton( Collection::class, Collection::class ); } }