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 |
UndefinedCallableHandler.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\Bridge\Twig;
13
14 use Symfony\Bundle\FullStack;
15 use Twig\Error\SyntaxError;
16
17 /**
18 * @internal
19 */
20 class UndefinedCallableHandler
21 {
22 private static $filterComponents = [
23 'humanize' => 'form',
24 'trans' => 'translation',
25 'transchoice' => 'translation',
26 'yaml_encode' => 'yaml',
27 'yaml_dump' => 'yaml',
28 ];
29
30 private static $functionComponents = [
31 'asset' => 'asset',
32 'asset_version' => 'asset',
33 'dump' => 'debug-bundle',
34 'expression' => 'expression-language',
35 'form_widget' => 'form',
36 'form_errors' => 'form',
37 'form_label' => 'form',
38 'form_row' => 'form',
39 'form_rest' => 'form',
40 'form' => 'form',
41 'form_start' => 'form',
42 'form_end' => 'form',
43 'csrf_token' => 'form',
44 'logout_url' => 'security-http',
45 'logout_path' => 'security-http',
46 'is_granted' => 'security-core',
47 'link' => 'web-link',
48 'preload' => 'web-link',
49 'dns_prefetch' => 'web-link',
50 'preconnect' => 'web-link',
51 'prefetch' => 'web-link',
52 'prerender' => 'web-link',
53 'workflow_can' => 'workflow',
54 'workflow_transitions' => 'workflow',
55 'workflow_has_marked_place' => 'workflow',
56 'workflow_marked_places' => 'workflow',
57 ];
58
59 private static $fullStackEnable = [
60 'form' => 'enable "framework.form"',
61 'security-core' => 'add the "SecurityBundle"',
62 'security-http' => 'add the "SecurityBundle"',
63 'web-link' => 'enable "framework.web_link"',
64 'workflow' => 'enable "framework.workflows"',
65 ];
66
67 public static function onUndefinedFilter($name)
68 {
69 if (!isset(self::$filterComponents[$name])) {
70 return false;
71 }
72
73 self::onUndefined($name, 'filter', self::$filterComponents[$name]);
74
75 return true;
76 }
77
78 public static function onUndefinedFunction($name)
79 {
80 if (!isset(self::$functionComponents[$name])) {
81 return false;
82 }
83
84 self::onUndefined($name, 'function', self::$functionComponents[$name]);
85
86 return true;
87 }
88
89 private static function onUndefined($name, $type, $component)
90 {
91 if (class_exists(FullStack::class) && isset(self::$fullStackEnable[$component])) {
92 throw new SyntaxError(sprintf('Did you forget to %s? Unknown %s "%s".', self::$fullStackEnable[$component], $type, $name));
93 }
94
95 throw new SyntaxError(sprintf('Did you forget to run "composer require symfony/%s"? Unknown %s "%s".', $component, $type, $name));
96 }
97 }
98