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 |
SessionValueResolver.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\HttpFoundation\Session\SessionInterface;
16 use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface;
17 use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
18
19 /**
20 * Yields the Session.
21 *
22 * @author Iltar van der Berg <kjarli@gmail.com>
23 */
24 final class SessionValueResolver implements ArgumentValueResolverInterface
25 {
26 /**
27 * {@inheritdoc}
28 */
29 public function supports(Request $request, ArgumentMetadata $argument)
30 {
31 $type = $argument->getType();
32 if (SessionInterface::class !== $type && !is_subclass_of($type, SessionInterface::class)) {
33 return false;
34 }
35
36 return $request->getSession() instanceof $type;
37 }
38
39 /**
40 * {@inheritdoc}
41 */
42 public function resolve(Request $request, ArgumentMetadata $argument)
43 {
44 yield $request->getSession();
45 }
46 }
47