Repository: symfony/symfony
File: src/Symfony/Component/HttpKernel/Attribute/Cache.php (PHP)

Code before:
        public bool $mustRevalidate = false,

        /**
         * Set "Vary" header.
         *
         * Example:
         * ['Accept-Encoding', 'User-Agent']
         *
         * @see https://symfony.com/doc/current/http_cache/cache_vary.html
         *
         * @var string[]
         */
        public array $vary = [],

        /**
         * A value evaluated to compute the Last-Modified HTTP header.
         *
         * The value may be either an ExpressionLanguage expression or a Closure and
         * receives all the request attributes and the resolved controller arguments.
         *
         * The result must be an instance of \DateTimeInterface.
         */
        public string|Expression|\Closure|null $lastModified = null,

        /**
         * A value evaluated to compute the ETag HTTP header.
         *
         * The value may be either an ExpressionLanguage expression or a Closure and
         * receives all the request attributes and the resolved controller arguments.
         *
         * The result must be a string that will be hashed.
         */
        public string|Expression|\Closure|null $etag = null,

        /**
         * max-stale Cache-Control header
         * It can be expressed in seconds or with a relative time format (1 day, 2 weeks, ...).
         */
        public int|string|null $maxStale = null,

        /**
         * stale-while-revalidate Cache-Control header
         * It can be expressed in seconds or with a relative time format (1 day, 2 weeks, ...).
         */
        public int|string|null $staleWhileRevalidate = null,

        /**
         * stale-if-error Cache-Control header
         * It can be expressed in seconds or with a relative time format (1 day, 2 weeks, ...).
         */
        public int|string|null $staleIfError = null,

Review comment (suggestion):
phpdoc should be added to describe the expected signature of the closure as `\Closure(array<string, mixed>, Request): \DateTimeInterface`.

And same for the etag closure (with a different return type of course)

Code after:
         */
        public bool $mustRevalidate = false,

        /**
         * Set "Vary" header.
         *
         * Example:
         * ['Accept-Encoding', 'User-Agent']
         *
         * @see https://symfony.com/doc/current/http_cache/cache_vary.html
         *
         * @var string[]
         */
        public array $vary = [],

        /**
         * A value evaluated to compute the Last-Modified HTTP header.
         *
         * The value may be either an ExpressionLanguage expression or a Closure and
         * receives all the request attributes and the resolved controller arguments.
         *
         * The result must be an instance of \DateTimeInterface.
         *
         * @var string|Expression|\Closure(array<string, mixed>, Request): \DateTimeInterface|null
         */
        public string|Expression|\Closure|null $lastModified = null,

        /**
         * A value evaluated to compute the ETag HTTP header.
         *
         * The value may be either an ExpressionLanguage expression or a Closure and
         * receives all the request attributes and the resolved controller arguments.
         *
         * The result must be a string that will be hashed.
         *
         * @var string|Expression|\Closure(array<string, mixed>, Request): string|null
         */
        public string|Expression|\Closure|null $etag = null,

        /**
         * max-stale Cache-Control header
         * It can be expressed in seconds or with a relative time format (1 day, 2 weeks, ...).
         */
        public int|string|null $maxStale = null,

        /**
         * stale-while-revalidate Cache-Control header
         * It can be expressed in seconds or with a relative time format (1 day, 2 weeks, ...).
         */
        public int|string|null $staleWhileRevalidate = null,