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 |
SyntaxError.php
01 <?php
02
03 /*
04 * This file is part of Twig.
05 *
06 * (c) Fabien Potencier
07 * (c) Armin Ronacher
08 *
09 * For the full copyright and license information, please view the LICENSE
10 * file that was distributed with this source code.
11 */
12
13 namespace Twig\Error;
14
15 /**
16 * \Exception thrown when a syntax error occurs during lexing or parsing of a template.
17 *
18 * @author Fabien Potencier <fabien@symfony.com>
19 */
20 class SyntaxError extends Error
21 {
22 /**
23 * Tweaks the error message to include suggestions.
24 *
25 * @param string $name The original name of the item that does not exist
26 * @param array $items An array of possible items
27 */
28 public function addSuggestions($name, array $items)
29 {
30 $alternatives = [];
31 foreach ($items as $item) {
32 $lev = levenshtein($name, $item);
33 if ($lev <= \strlen($name) / 3 || false !== strpos($item, $name)) {
34 $alternatives[$item] = $lev;
35 }
36 }
37
38 if (!$alternatives) {
39 return;
40 }
41
42 asort($alternatives);
43
44 $this->appendMessage(sprintf(' Did you mean "%s"?', implode('", "', array_keys($alternatives))));
45 }
46 }
47
48 class_alias('Twig\Error\SyntaxError', 'Twig_Error_Syntax');
49