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 |
Core.php
001 <?php
002
003 /**
004 * @package s9e\TextFormatter
005 * @copyright Copyright (c) 2010-2022 The s9e authors
006 * @license http://www.opensource.org/licenses/mit-license.php The MIT License
007 */
008 namespace s9e\TextFormatter\Configurator\RendererGenerators\PHP\XPathConvertor\Convertors;
009
010 class Core extends AbstractConvertor
011 {
012 /**
013 * {@inheritdoc}
014 */
015 public function getMatchers(): array
016 {
017 return [
018 'String:Attribute' => '@ ([-\\w]++)',
019 'String:Dot' => '\\.',
020 'Number:LiteralNumber' => '(-?) (\\d++)',
021 'String:LiteralString' => '("[^"]*"|\'[^\']*\')',
022 'String:LocalName' => 'local-name \\(\\)',
023 'String:Name' => 'name \\(\\)',
024 'String:Parameter' => '\\$(\\w+)'
025 ];
026 }
027
028 /**
029 * Convert the attribute syntax
030 *
031 * @param string $attrName
032 * @return string
033 */
034 public function parseAttribute($attrName)
035 {
036 return '$node->getAttribute(' . var_export($attrName, true) . ')';
037 }
038
039 /**
040 * Convert the dot syntax
041 *
042 * @return string
043 */
044 public function parseDot()
045 {
046 return '$node->textContent';
047 }
048
049 /**
050 * Convert a literal number
051 *
052 * @param string $sign
053 * @param string $number
054 * @return string
055 */
056 public function parseLiteralNumber($sign, $number)
057 {
058 return $this->normalizeNumber($sign, $number);
059 }
060
061 /**
062 * Convert a literal string
063 *
064 * @param string $string Literal string, including the quotes
065 * @return string
066 */
067 public function parseLiteralString($string)
068 {
069 return var_export(substr($string, 1, -1), true);
070 }
071
072 /**
073 * Convert a local-name() function call
074 *
075 * @return string
076 */
077 public function parseLocalName()
078 {
079 return '$node->localName';
080 }
081
082 /**
083 * Convert a name() function call
084 *
085 * @return string
086 */
087 public function parseName()
088 {
089 return '$node->nodeName';
090 }
091
092 /**
093 * Convert the parameter syntax
094 *
095 * @param string $paramName
096 * @return string
097 */
098 public function parseParameter($paramName)
099 {
100 return '$this->params[' . var_export($paramName, true) . ']';
101 }
102 }