Add support for functions/filters/tests stubs

by @fabpot

Some issues have been detected in this pull request

0
Coding Standard

0
Common Typos

0
File Permissions

0
Merge Commits

Issues that can be fixed by applying a patch

Review the proposed patch then download it to apply it manually or execute the following command from the repository root directory:

curl https://fabbot.io/patch/twigphp/Twig/4304/e0feaf1635cfa45ac92f193d4e1b9a7637f00e43/exception_messages.diff | patch -p0
diff -ru src/Environment.php src/Environment.php
--- src/Environment.php	2024-10-02 12:41:30.855477035 +0000
+++ src/Environment.php	2024-10-02 12:41:32.078520604 +0000
@@ -925,6 +925,6 @@
 
     private function createStub(string $type, $name, $package): callable
     {
-        return fn () => throw new RuntimeError(\sprintf('Cannot use the "%s" %s because the "%s" composer package is not installed. Try running "composer require %s".', $name, $type, $package, $package));
+        return fn () => throw new RuntimeError(\sprintf('Cannot use the "%s" "%s" because the "%s" composer package is not installed. Try running "composer require "%s"".', $name, $type, $package, $package));
     }
 }

0
Usage of void in test files

0
Use ::class whenever possible

0
Deprecation Messages