Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
VariadicValueResolver.php
01 <?php
02
03 /*
04 * This file is part of the Symfony package.
05 *
06 * (c) Fabien Potencier <fabien@symfony.com>
07 *
08 * For the full copyright and license information, please view the LICENSE
09 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\HttpKernel\Controller\ArgumentResolver;
13
14 use Symfony\Component\HttpFoundation\Request;
15 use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface;
16 use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
17
18 /**
19 * Yields a variadic argument's values from the request attributes.
20 *
21 * @author Iltar van der Berg <kjarli@gmail.com>
22 */
23 final class VariadicValueResolver implements ArgumentValueResolverInterface
24 {
25 /**
26 * {@inheritdoc}
27 */
28 public function supports(Request $request, ArgumentMetadata $argument)
29 {
30 return $argument->isVariadic() && $request->attributes->has($argument->getName());
31 }
32
33 /**
34 * {@inheritdoc}
35 */
36 public function resolve(Request $request, ArgumentMetadata $argument)
37 {
38 $values = $request->attributes->get($argument->getName());
39
40 if (!\is_array($values)) {
41 throw new \InvalidArgumentException(sprintf('The action argument "...$%1$s" is required to be an array, the request attribute "%1$s" contains a type of "%2$s" instead.', $argument->getName(), \gettype($values)));
42 }
43
44 foreach ($values as $value) {
45 yield $value;
46 }
47 }
48 }
49