PluginProbe
WindPress – Tailwind CSS integration for WordPress / 3.2.90
WindPress – Tailwind CSS integration for WordPress v3.2.90
3.2.90 3.2.89 3.2.88 3.2.87 3.2.86 3.2.85 3.2.84 3.2.83 3.2.82 3.2.81 trunk 3.0.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.17 3.0.2 3.0.3 3.0.4 3.0.5 All 144 releases
windpress / vendor / symfony / yaml / ParserState.php

ParserState.php in WindPress – Tailwind CSS integration for WordPress 3.2.90, at vendor/symfony/yaml/ParserState.php

63 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11 namespace WindPressDeps\Symfony\Component\Yaml;
12
13 use WindPressDeps\Symfony\Component\Yaml\Exception\ParseException;
14 use WindPressDeps\Symfony\Component\Yaml\Tag\TaggedValue;
15 /**
16 * @internal
17 */
18 final class ParserState
19 {
20 public $maxNestingLevel = Parser::DEFAULT_MAX_NESTING_LEVEL;
21 public $currentNestingLevel = 0;
22 public $maxAliasesForCollections = Parser::DEFAULT_MAX_ALIASES_FOR_COLLECTIONS;
23 public $collectionAliasCount = 0;
24 public $aliasesEnabled = \true;
25 public function reset(): void
26 {
27 $this->currentNestingLevel = 0;
28 $this->collectionAliasCount = 0;
29 $this->aliasesEnabled = \true;
30 }
31 public function enterNestingLevel(int $line, ?string $snippet, ?string $filename): void
32 {
33 if (++$this->currentNestingLevel > $this->maxNestingLevel) {
34 --$this->currentNestingLevel;
35 throw new ParseException(sprintf('Maximum nesting depth of %d exceeded.', $this->maxNestingLevel), $line, $snippet, $filename);
36 }
37 }
38 public function leaveNestingLevel(): void
39 {
40 if ($this->currentNestingLevel > 0) {
41 --$this->currentNestingLevel;
42 }
43 }
44 /**
45 * @param mixed $refValue
46 */
47 public function countAlias($refValue, int $line, ?string $snippet, ?string $filename): void
48 {
49 if (!$this->aliasesEnabled) {
50 throw new ParseException('Aliases are disabled.', $line, $snippet, $filename);
51 }
52 if ($refValue instanceof TaggedValue) {
53 $refValue = $refValue->getValue();
54 }
55 if (!\is_array($refValue) && !$refValue instanceof \stdClass) {
56 return;
57 }
58 if (++$this->collectionAliasCount > $this->maxAliasesForCollections) {
59 throw new ParseException(sprintf('Maximum number of collection aliases (%d) exceeded. This limit can be increased via the Parser constructor.', $this->maxAliasesForCollections), $line, $snippet, $filename);
60 }
61 }
62 }
63