minor #4522 Add @template on RuntimeLoaderinterface (Twig 4) (smnandre)

This PR was merged into the 4.x branch.

Discussion
----------

Add `@template` on RuntimeLoaderinterface (Twig 4)

Do php-stan annotation have an impact on BC promise?

The interface uses the term "class" already.. i'm guessing it's ok ?

Commits
-------

c24c71a3ca Add `@template` on RuntimeLoaderinterface (Twig 4)
This commit is contained in:
Fabien Potencier
2025-01-02 09:45:15 +01:00
+5 -1
View File
@@ -21,7 +21,11 @@ interface RuntimeLoaderInterface
/**
* Creates the runtime implementation of a Twig element (filter/function/test).
*
* @return object|null The runtime instance or null if the loader does not know how to create the runtime for this class
* @template TRuntime of object
*
* @param class-string<TRuntime> $class A runtime class name
*
* @return TRuntime|null The runtime instance or null if the loader does not know how to create the runtime for this class
*/
public function load(string $class): ?object;
}