@vituum/vite-plugin-latte 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -2
- package/package.json +1 -1
- package/vendor/autoload.php +1 -6
- package/vendor/bin/latte-lint +1 -14
- package/vendor/composer/InstalledVersions.php +7 -9
- package/vendor/composer/autoload_classmap.php +7 -10
- package/vendor/composer/autoload_namespaces.php +1 -1
- package/vendor/composer/autoload_psr4.php +1 -1
- package/vendor/composer/autoload_real.php +26 -7
- package/vendor/composer/autoload_static.php +8 -11
- package/vendor/composer/installed.json +7 -7
- package/vendor/composer/installed.php +6 -6
- package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/FunctionCallNode.php +2 -11
- package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/{UndefinedsafePropertyFetchNode.php → FunctionCallableNode.php} +6 -9
- package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/MethodCallNode.php +4 -13
- package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/{NullsafePropertyFetchNode.php → MethodCallableNode.php} +5 -4
- package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/PropertyFetchNode.php +2 -1
- package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/StaticCallNode.php +2 -12
- package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/{NullsafeMethodCallNode.php → StaticCallableNode.php} +12 -14
- package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Scalar/EncapsedStringNode.php +8 -6
- package/vendor/latte/latte/src/Latte/Compiler/PrintContext.php +6 -3
- package/vendor/latte/latte/src/Latte/Compiler/TagLexer.php +23 -6
- package/vendor/latte/latte/src/Latte/Compiler/TagParser.php +87 -0
- package/vendor/latte/latte/src/Latte/Compiler/TagParserData.php +306 -285
- package/vendor/latte/latte/src/Latte/Compiler/TemplateLexer.php +31 -43
- package/vendor/latte/latte/src/Latte/Compiler/Token.php +17 -13
- package/vendor/latte/latte/src/Latte/Engine.php +2 -2
- package/vendor/latte/latte/src/Latte/Essential/CoreExtension.php +4 -2
- package/vendor/latte/latte/src/Latte/Essential/Passes.php +1 -1
- package/vendor/latte/latte/src/Latte/Essential/TranslatorExtension.php +2 -2
- package/vendor/latte/latte/src/Latte/Sandbox/Nodes/FunctionCallNode.php +0 -5
- package/vendor/latte/latte/src/Latte/Sandbox/Nodes/FunctionCallableNode.php +29 -0
- package/vendor/latte/latte/src/Latte/Sandbox/Nodes/MethodCallNode.php +3 -8
- package/vendor/latte/latte/src/Latte/Sandbox/Nodes/{NullsafePropertyFetchNode.php → MethodCallableNode.php} +4 -6
- package/vendor/latte/latte/src/Latte/Sandbox/Nodes/PropertyFetchNode.php +2 -2
- package/vendor/latte/latte/src/Latte/Sandbox/Nodes/StaticCallNode.php +0 -6
- package/vendor/latte/latte/src/Latte/Sandbox/Nodes/StaticCallableNode.php +30 -0
- package/vendor/latte/latte/src/Latte/Sandbox/SandboxExtension.php +3 -5
- package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/UndefinedsafeMethodCallNode.php +0 -49
- package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/VariadicPlaceholderNode.php +0 -29
- package/vendor/latte/latte/src/Latte/Sandbox/Nodes/NullsafeMethodCallNode.php +0 -31
- package/vendor/latte/latte/src/Latte/Sandbox/Nodes/UndefinedsafeMethodCallNode.php +0 -31
- package/vendor/latte/latte/src/Latte/Sandbox/Nodes/UndefinedsafePropertyFetchNode.php +0 -32
package/index.js
CHANGED
|
@@ -93,6 +93,9 @@ const latte = (params = {}) => {
|
|
|
93
93
|
transformIndexHtml: {
|
|
94
94
|
enforce: 'pre',
|
|
95
95
|
async transform(content, { path, filename, server }) {
|
|
96
|
+
path = path.replace('?raw', '')
|
|
97
|
+
filename = filename.replace('?raw', '')
|
|
98
|
+
|
|
96
99
|
if (
|
|
97
100
|
!params.filetypes.html.test(path) &&
|
|
98
101
|
!params.filetypes.json.test(path) &&
|
|
@@ -129,8 +132,8 @@ const latte = (params = {}) => {
|
|
|
129
132
|
},
|
|
130
133
|
handleHotUpdate({ file, server }) {
|
|
131
134
|
if (
|
|
132
|
-
typeof params.reload === 'function' && params.reload(file) ||
|
|
133
|
-
params.reload && (params.filetypes.html.test(file) || params.filetypes.json.test(file))
|
|
135
|
+
(typeof params.reload === 'function' && params.reload(file)) ||
|
|
136
|
+
(typeof params.reload === 'boolean' && params.reload && (params.filetypes.html.test(file) || params.filetypes.json.test(file)))
|
|
134
137
|
) {
|
|
135
138
|
server.ws.send({ type: 'full-reload' })
|
|
136
139
|
}
|
package/package.json
CHANGED
package/vendor/autoload.php
CHANGED
|
@@ -2,11 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
// autoload.php @generated by Composer
|
|
4
4
|
|
|
5
|
-
if (PHP_VERSION_ID < 50600) {
|
|
6
|
-
echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
|
7
|
-
exit(1);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
5
|
require_once __DIR__ . '/composer/autoload_real.php';
|
|
11
6
|
|
|
12
|
-
return
|
|
7
|
+
return ComposerAutoloaderInit19cfb30b66a778b432af39bbd1e78bca::getLoader();
|
package/vendor/bin/latte-lint
CHANGED
|
@@ -66,16 +66,6 @@ if (PHP_VERSION_ID < 80000) {
|
|
|
66
66
|
return $operation ? flock($this->handle, $operation) : true;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
public function stream_seek($offset, $whence)
|
|
70
|
-
{
|
|
71
|
-
if (0 === fseek($this->handle, $offset, $whence)) {
|
|
72
|
-
$this->position = ftell($this->handle);
|
|
73
|
-
return true;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
69
|
public function stream_tell()
|
|
80
70
|
{
|
|
81
71
|
return $this->position;
|
|
@@ -108,10 +98,7 @@ if (PHP_VERSION_ID < 80000) {
|
|
|
108
98
|
}
|
|
109
99
|
}
|
|
110
100
|
|
|
111
|
-
if (
|
|
112
|
-
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|
|
113
|
-
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
|
|
114
|
-
) {
|
|
101
|
+
if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) {
|
|
115
102
|
include("phpvfscomposer://" . __DIR__ . '/..'.'/latte/latte/bin/latte-lint');
|
|
116
103
|
exit(0);
|
|
117
104
|
}
|
|
@@ -21,14 +21,12 @@ use Composer\Semver\VersionParser;
|
|
|
21
21
|
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
|
22
22
|
*
|
|
23
23
|
* To require its presence, you can require `composer-runtime-api ^2.0`
|
|
24
|
-
*
|
|
25
|
-
* @final
|
|
26
24
|
*/
|
|
27
25
|
class InstalledVersions
|
|
28
26
|
{
|
|
29
27
|
/**
|
|
30
28
|
* @var mixed[]|null
|
|
31
|
-
* @psalm-var array{root: array{name: string,
|
|
29
|
+
* @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
|
|
32
30
|
*/
|
|
33
31
|
private static $installed;
|
|
34
32
|
|
|
@@ -39,7 +37,7 @@ class InstalledVersions
|
|
|
39
37
|
|
|
40
38
|
/**
|
|
41
39
|
* @var array[]
|
|
42
|
-
* @psalm-var array<string, array{root: array{name: string,
|
|
40
|
+
* @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
|
43
41
|
*/
|
|
44
42
|
private static $installedByVendor = array();
|
|
45
43
|
|
|
@@ -243,7 +241,7 @@ class InstalledVersions
|
|
|
243
241
|
|
|
244
242
|
/**
|
|
245
243
|
* @return array
|
|
246
|
-
* @psalm-return array{name: string,
|
|
244
|
+
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
|
|
247
245
|
*/
|
|
248
246
|
public static function getRootPackage()
|
|
249
247
|
{
|
|
@@ -257,7 +255,7 @@ class InstalledVersions
|
|
|
257
255
|
*
|
|
258
256
|
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
|
259
257
|
* @return array[]
|
|
260
|
-
* @psalm-return array{root: array{name: string,
|
|
258
|
+
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
|
|
261
259
|
*/
|
|
262
260
|
public static function getRawData()
|
|
263
261
|
{
|
|
@@ -280,7 +278,7 @@ class InstalledVersions
|
|
|
280
278
|
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
|
281
279
|
*
|
|
282
280
|
* @return array[]
|
|
283
|
-
* @psalm-return list<array{root: array{name: string,
|
|
281
|
+
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
|
284
282
|
*/
|
|
285
283
|
public static function getAllRawData()
|
|
286
284
|
{
|
|
@@ -303,7 +301,7 @@ class InstalledVersions
|
|
|
303
301
|
* @param array[] $data A vendor/composer/installed.php data set
|
|
304
302
|
* @return void
|
|
305
303
|
*
|
|
306
|
-
* @psalm-param array{root: array{name: string,
|
|
304
|
+
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
|
|
307
305
|
*/
|
|
308
306
|
public static function reload($data)
|
|
309
307
|
{
|
|
@@ -313,7 +311,7 @@ class InstalledVersions
|
|
|
313
311
|
|
|
314
312
|
/**
|
|
315
313
|
* @return array[]
|
|
316
|
-
* @psalm-return list<array{root: array{name: string,
|
|
314
|
+
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
|
317
315
|
*/
|
|
318
316
|
private static function getInstalled()
|
|
319
317
|
{
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// autoload_classmap.php @generated by Composer
|
|
4
4
|
|
|
5
|
-
$vendorDir = dirname(
|
|
5
|
+
$vendorDir = dirname(dirname(__FILE__));
|
|
6
6
|
$baseDir = dirname($vendorDir);
|
|
7
7
|
|
|
8
8
|
return array(
|
|
@@ -46,24 +46,23 @@ return array(
|
|
|
46
46
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\ErrorSuppressNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ErrorSuppressNode.php',
|
|
47
47
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\FilterCallNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/FilterCallNode.php',
|
|
48
48
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\FunctionCallNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/FunctionCallNode.php',
|
|
49
|
+
'Latte\\Compiler\\Nodes\\Php\\Expression\\FunctionCallableNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/FunctionCallableNode.php',
|
|
49
50
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\InRangeNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/InRangeNode.php',
|
|
50
51
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\InstanceofNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/InstanceofNode.php',
|
|
51
52
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\IssetNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/IssetNode.php',
|
|
52
53
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\MatchNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/MatchNode.php',
|
|
53
54
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\MethodCallNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/MethodCallNode.php',
|
|
55
|
+
'Latte\\Compiler\\Nodes\\Php\\Expression\\MethodCallableNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/MethodCallableNode.php',
|
|
54
56
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\NewNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/NewNode.php',
|
|
55
57
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\NotNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/NotNode.php',
|
|
56
|
-
'Latte\\Compiler\\Nodes\\Php\\Expression\\NullsafeMethodCallNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/NullsafeMethodCallNode.php',
|
|
57
|
-
'Latte\\Compiler\\Nodes\\Php\\Expression\\NullsafePropertyFetchNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/NullsafePropertyFetchNode.php',
|
|
58
58
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\PostOpNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/PostOpNode.php',
|
|
59
59
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\PreOpNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/PreOpNode.php',
|
|
60
60
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\PropertyFetchNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/PropertyFetchNode.php',
|
|
61
61
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\StaticCallNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/StaticCallNode.php',
|
|
62
|
+
'Latte\\Compiler\\Nodes\\Php\\Expression\\StaticCallableNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/StaticCallableNode.php',
|
|
62
63
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\StaticPropertyFetchNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/StaticPropertyFetchNode.php',
|
|
63
64
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\TernaryNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/TernaryNode.php',
|
|
64
65
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\UnaryOpNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/UnaryOpNode.php',
|
|
65
|
-
'Latte\\Compiler\\Nodes\\Php\\Expression\\UndefinedsafeMethodCallNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/UndefinedsafeMethodCallNode.php',
|
|
66
|
-
'Latte\\Compiler\\Nodes\\Php\\Expression\\UndefinedsafePropertyFetchNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/UndefinedsafePropertyFetchNode.php',
|
|
67
66
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\VariableNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/VariableNode.php',
|
|
68
67
|
'Latte\\Compiler\\Nodes\\Php\\FilterNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/FilterNode.php',
|
|
69
68
|
'Latte\\Compiler\\Nodes\\Php\\IdentifierNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/IdentifierNode.php',
|
|
@@ -84,7 +83,6 @@ return array(
|
|
|
84
83
|
'Latte\\Compiler\\Nodes\\Php\\SuperiorTypeNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/SuperiorTypeNode.php',
|
|
85
84
|
'Latte\\Compiler\\Nodes\\Php\\UnionTypeNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/UnionTypeNode.php',
|
|
86
85
|
'Latte\\Compiler\\Nodes\\Php\\VarLikeIdentifierNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/VarLikeIdentifierNode.php',
|
|
87
|
-
'Latte\\Compiler\\Nodes\\Php\\VariadicPlaceholderNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/VariadicPlaceholderNode.php',
|
|
88
86
|
'Latte\\Compiler\\Nodes\\StatementNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/StatementNode.php',
|
|
89
87
|
'Latte\\Compiler\\Nodes\\TemplateNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/TemplateNode.php',
|
|
90
88
|
'Latte\\Compiler\\Nodes\\TextNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/TextNode.php',
|
|
@@ -168,15 +166,14 @@ return array(
|
|
|
168
166
|
'Latte\\Runtime\\HtmlStringable' => $vendorDir . '/latte/latte/src/Latte/Runtime/HtmlStringable.php',
|
|
169
167
|
'Latte\\Runtime\\Template' => $vendorDir . '/latte/latte/src/Latte/Runtime/Template.php',
|
|
170
168
|
'Latte\\Sandbox\\Nodes\\FunctionCallNode' => $vendorDir . '/latte/latte/src/Latte/Sandbox/Nodes/FunctionCallNode.php',
|
|
169
|
+
'Latte\\Sandbox\\Nodes\\FunctionCallableNode' => $vendorDir . '/latte/latte/src/Latte/Sandbox/Nodes/FunctionCallableNode.php',
|
|
171
170
|
'Latte\\Sandbox\\Nodes\\MethodCallNode' => $vendorDir . '/latte/latte/src/Latte/Sandbox/Nodes/MethodCallNode.php',
|
|
172
|
-
'Latte\\Sandbox\\Nodes\\
|
|
173
|
-
'Latte\\Sandbox\\Nodes\\NullsafePropertyFetchNode' => $vendorDir . '/latte/latte/src/Latte/Sandbox/Nodes/NullsafePropertyFetchNode.php',
|
|
171
|
+
'Latte\\Sandbox\\Nodes\\MethodCallableNode' => $vendorDir . '/latte/latte/src/Latte/Sandbox/Nodes/MethodCallableNode.php',
|
|
174
172
|
'Latte\\Sandbox\\Nodes\\PropertyFetchNode' => $vendorDir . '/latte/latte/src/Latte/Sandbox/Nodes/PropertyFetchNode.php',
|
|
175
173
|
'Latte\\Sandbox\\Nodes\\SandboxNode' => $vendorDir . '/latte/latte/src/Latte/Sandbox/Nodes/SandboxNode.php',
|
|
176
174
|
'Latte\\Sandbox\\Nodes\\StaticCallNode' => $vendorDir . '/latte/latte/src/Latte/Sandbox/Nodes/StaticCallNode.php',
|
|
175
|
+
'Latte\\Sandbox\\Nodes\\StaticCallableNode' => $vendorDir . '/latte/latte/src/Latte/Sandbox/Nodes/StaticCallableNode.php',
|
|
177
176
|
'Latte\\Sandbox\\Nodes\\StaticPropertyFetchNode' => $vendorDir . '/latte/latte/src/Latte/Sandbox/Nodes/StaticPropertyFetchNode.php',
|
|
178
|
-
'Latte\\Sandbox\\Nodes\\UndefinedsafeMethodCallNode' => $vendorDir . '/latte/latte/src/Latte/Sandbox/Nodes/UndefinedsafeMethodCallNode.php',
|
|
179
|
-
'Latte\\Sandbox\\Nodes\\UndefinedsafePropertyFetchNode' => $vendorDir . '/latte/latte/src/Latte/Sandbox/Nodes/UndefinedsafePropertyFetchNode.php',
|
|
180
177
|
'Latte\\Sandbox\\RuntimeChecker' => $vendorDir . '/latte/latte/src/Latte/Sandbox/RuntimeChecker.php',
|
|
181
178
|
'Latte\\Sandbox\\SandboxExtension' => $vendorDir . '/latte/latte/src/Latte/Sandbox/SandboxExtension.php',
|
|
182
179
|
'Latte\\Sandbox\\SecurityPolicy' => $vendorDir . '/latte/latte/src/Latte/Sandbox/SecurityPolicy.php',
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// autoload_real.php @generated by Composer
|
|
4
4
|
|
|
5
|
-
class
|
|
5
|
+
class ComposerAutoloaderInit19cfb30b66a778b432af39bbd1e78bca
|
|
6
6
|
{
|
|
7
7
|
private static $loader;
|
|
8
8
|
|
|
@@ -24,12 +24,31 @@ class ComposerAutoloaderInitda1ce49ef3085539a79eddbb995629f3
|
|
|
24
24
|
|
|
25
25
|
require __DIR__ . '/platform_check.php';
|
|
26
26
|
|
|
27
|
-
spl_autoload_register(array('
|
|
28
|
-
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(
|
|
29
|
-
spl_autoload_unregister(array('
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
spl_autoload_register(array('ComposerAutoloaderInit19cfb30b66a778b432af39bbd1e78bca', 'loadClassLoader'), true, true);
|
|
28
|
+
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
|
29
|
+
spl_autoload_unregister(array('ComposerAutoloaderInit19cfb30b66a778b432af39bbd1e78bca', 'loadClassLoader'));
|
|
30
|
+
|
|
31
|
+
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
|
32
|
+
if ($useStaticLoader) {
|
|
33
|
+
require __DIR__ . '/autoload_static.php';
|
|
34
|
+
|
|
35
|
+
call_user_func(\Composer\Autoload\ComposerStaticInit19cfb30b66a778b432af39bbd1e78bca::getInitializer($loader));
|
|
36
|
+
} else {
|
|
37
|
+
$map = require __DIR__ . '/autoload_namespaces.php';
|
|
38
|
+
foreach ($map as $namespace => $path) {
|
|
39
|
+
$loader->set($namespace, $path);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
$map = require __DIR__ . '/autoload_psr4.php';
|
|
43
|
+
foreach ($map as $namespace => $path) {
|
|
44
|
+
$loader->setPsr4($namespace, $path);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
$classMap = require __DIR__ . '/autoload_classmap.php';
|
|
48
|
+
if ($classMap) {
|
|
49
|
+
$loader->addClassMap($classMap);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
33
52
|
|
|
34
53
|
$loader->register(true);
|
|
35
54
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
namespace Composer\Autoload;
|
|
6
6
|
|
|
7
|
-
class
|
|
7
|
+
class ComposerStaticInit19cfb30b66a778b432af39bbd1e78bca
|
|
8
8
|
{
|
|
9
9
|
public static $classMap = array (
|
|
10
10
|
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
|
@@ -47,24 +47,23 @@ class ComposerStaticInitda1ce49ef3085539a79eddbb995629f3
|
|
|
47
47
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\ErrorSuppressNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/ErrorSuppressNode.php',
|
|
48
48
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\FilterCallNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/FilterCallNode.php',
|
|
49
49
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\FunctionCallNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/FunctionCallNode.php',
|
|
50
|
+
'Latte\\Compiler\\Nodes\\Php\\Expression\\FunctionCallableNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/FunctionCallableNode.php',
|
|
50
51
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\InRangeNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/InRangeNode.php',
|
|
51
52
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\InstanceofNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/InstanceofNode.php',
|
|
52
53
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\IssetNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/IssetNode.php',
|
|
53
54
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\MatchNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/MatchNode.php',
|
|
54
55
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\MethodCallNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/MethodCallNode.php',
|
|
56
|
+
'Latte\\Compiler\\Nodes\\Php\\Expression\\MethodCallableNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/MethodCallableNode.php',
|
|
55
57
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\NewNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/NewNode.php',
|
|
56
58
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\NotNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/NotNode.php',
|
|
57
|
-
'Latte\\Compiler\\Nodes\\Php\\Expression\\NullsafeMethodCallNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/NullsafeMethodCallNode.php',
|
|
58
|
-
'Latte\\Compiler\\Nodes\\Php\\Expression\\NullsafePropertyFetchNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/NullsafePropertyFetchNode.php',
|
|
59
59
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\PostOpNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/PostOpNode.php',
|
|
60
60
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\PreOpNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/PreOpNode.php',
|
|
61
61
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\PropertyFetchNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/PropertyFetchNode.php',
|
|
62
62
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\StaticCallNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/StaticCallNode.php',
|
|
63
|
+
'Latte\\Compiler\\Nodes\\Php\\Expression\\StaticCallableNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/StaticCallableNode.php',
|
|
63
64
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\StaticPropertyFetchNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/StaticPropertyFetchNode.php',
|
|
64
65
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\TernaryNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/TernaryNode.php',
|
|
65
66
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\UnaryOpNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/UnaryOpNode.php',
|
|
66
|
-
'Latte\\Compiler\\Nodes\\Php\\Expression\\UndefinedsafeMethodCallNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/UndefinedsafeMethodCallNode.php',
|
|
67
|
-
'Latte\\Compiler\\Nodes\\Php\\Expression\\UndefinedsafePropertyFetchNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/UndefinedsafePropertyFetchNode.php',
|
|
68
67
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\VariableNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/VariableNode.php',
|
|
69
68
|
'Latte\\Compiler\\Nodes\\Php\\FilterNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/FilterNode.php',
|
|
70
69
|
'Latte\\Compiler\\Nodes\\Php\\IdentifierNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/IdentifierNode.php',
|
|
@@ -85,7 +84,6 @@ class ComposerStaticInitda1ce49ef3085539a79eddbb995629f3
|
|
|
85
84
|
'Latte\\Compiler\\Nodes\\Php\\SuperiorTypeNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/SuperiorTypeNode.php',
|
|
86
85
|
'Latte\\Compiler\\Nodes\\Php\\UnionTypeNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/UnionTypeNode.php',
|
|
87
86
|
'Latte\\Compiler\\Nodes\\Php\\VarLikeIdentifierNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/VarLikeIdentifierNode.php',
|
|
88
|
-
'Latte\\Compiler\\Nodes\\Php\\VariadicPlaceholderNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/VariadicPlaceholderNode.php',
|
|
89
87
|
'Latte\\Compiler\\Nodes\\StatementNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/StatementNode.php',
|
|
90
88
|
'Latte\\Compiler\\Nodes\\TemplateNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/TemplateNode.php',
|
|
91
89
|
'Latte\\Compiler\\Nodes\\TextNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/TextNode.php',
|
|
@@ -169,15 +167,14 @@ class ComposerStaticInitda1ce49ef3085539a79eddbb995629f3
|
|
|
169
167
|
'Latte\\Runtime\\HtmlStringable' => __DIR__ . '/..' . '/latte/latte/src/Latte/Runtime/HtmlStringable.php',
|
|
170
168
|
'Latte\\Runtime\\Template' => __DIR__ . '/..' . '/latte/latte/src/Latte/Runtime/Template.php',
|
|
171
169
|
'Latte\\Sandbox\\Nodes\\FunctionCallNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/Nodes/FunctionCallNode.php',
|
|
170
|
+
'Latte\\Sandbox\\Nodes\\FunctionCallableNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/Nodes/FunctionCallableNode.php',
|
|
172
171
|
'Latte\\Sandbox\\Nodes\\MethodCallNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/Nodes/MethodCallNode.php',
|
|
173
|
-
'Latte\\Sandbox\\Nodes\\
|
|
174
|
-
'Latte\\Sandbox\\Nodes\\NullsafePropertyFetchNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/Nodes/NullsafePropertyFetchNode.php',
|
|
172
|
+
'Latte\\Sandbox\\Nodes\\MethodCallableNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/Nodes/MethodCallableNode.php',
|
|
175
173
|
'Latte\\Sandbox\\Nodes\\PropertyFetchNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/Nodes/PropertyFetchNode.php',
|
|
176
174
|
'Latte\\Sandbox\\Nodes\\SandboxNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/Nodes/SandboxNode.php',
|
|
177
175
|
'Latte\\Sandbox\\Nodes\\StaticCallNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/Nodes/StaticCallNode.php',
|
|
176
|
+
'Latte\\Sandbox\\Nodes\\StaticCallableNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/Nodes/StaticCallableNode.php',
|
|
178
177
|
'Latte\\Sandbox\\Nodes\\StaticPropertyFetchNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/Nodes/StaticPropertyFetchNode.php',
|
|
179
|
-
'Latte\\Sandbox\\Nodes\\UndefinedsafeMethodCallNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/Nodes/UndefinedsafeMethodCallNode.php',
|
|
180
|
-
'Latte\\Sandbox\\Nodes\\UndefinedsafePropertyFetchNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/Nodes/UndefinedsafePropertyFetchNode.php',
|
|
181
178
|
'Latte\\Sandbox\\RuntimeChecker' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/RuntimeChecker.php',
|
|
182
179
|
'Latte\\Sandbox\\SandboxExtension' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/SandboxExtension.php',
|
|
183
180
|
'Latte\\Sandbox\\SecurityPolicy' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/SecurityPolicy.php',
|
|
@@ -189,7 +186,7 @@ class ComposerStaticInitda1ce49ef3085539a79eddbb995629f3
|
|
|
189
186
|
public static function getInitializer(ClassLoader $loader)
|
|
190
187
|
{
|
|
191
188
|
return \Closure::bind(function () use ($loader) {
|
|
192
|
-
$loader->classMap =
|
|
189
|
+
$loader->classMap = ComposerStaticInit19cfb30b66a778b432af39bbd1e78bca::$classMap;
|
|
193
190
|
|
|
194
191
|
}, null, ClassLoader::class);
|
|
195
192
|
}
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
"packages": [
|
|
3
3
|
{
|
|
4
4
|
"name": "latte/latte",
|
|
5
|
-
"version": "v3.0.
|
|
6
|
-
"version_normalized": "3.0.
|
|
5
|
+
"version": "v3.0.2",
|
|
6
|
+
"version_normalized": "3.0.2.0",
|
|
7
7
|
"source": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/nette/latte.git",
|
|
10
|
-
"reference": "
|
|
10
|
+
"reference": "c3eee2e4e2c21cdf9f9c158c4bfa6150625457e1"
|
|
11
11
|
},
|
|
12
12
|
"dist": {
|
|
13
13
|
"type": "zip",
|
|
14
|
-
"url": "https://api.github.com/repos/nette/latte/zipball/
|
|
15
|
-
"reference": "
|
|
14
|
+
"url": "https://api.github.com/repos/nette/latte/zipball/c3eee2e4e2c21cdf9f9c158c4bfa6150625457e1",
|
|
15
|
+
"reference": "c3eee2e4e2c21cdf9f9c158c4bfa6150625457e1",
|
|
16
16
|
"shasum": ""
|
|
17
17
|
},
|
|
18
18
|
"require": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"nette/php-generator": "to use tag {templatePrint}",
|
|
38
38
|
"nette/utils": "to use filter |webalize"
|
|
39
39
|
},
|
|
40
|
-
"time": "2022-06-
|
|
40
|
+
"time": "2022-06-15T13:42:57+00:00",
|
|
41
41
|
"bin": [
|
|
42
42
|
"bin/latte-lint"
|
|
43
43
|
],
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
],
|
|
84
84
|
"support": {
|
|
85
85
|
"issues": "https://github.com/nette/latte/issues",
|
|
86
|
-
"source": "https://github.com/nette/latte/tree/v3.0.
|
|
86
|
+
"source": "https://github.com/nette/latte/tree/v3.0.2"
|
|
87
87
|
},
|
|
88
88
|
"install-path": "../latte/latte"
|
|
89
89
|
}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
<?php return array(
|
|
2
2
|
'root' => array(
|
|
3
|
-
'name' => '__root__',
|
|
4
3
|
'pretty_version' => 'dev-main',
|
|
5
4
|
'version' => 'dev-main',
|
|
6
|
-
'reference' => '4b13b1e1b01461c4060434ea2362d03de525c3ea',
|
|
7
5
|
'type' => 'library',
|
|
8
6
|
'install_path' => __DIR__ . '/../../',
|
|
9
7
|
'aliases' => array(),
|
|
8
|
+
'reference' => '9a94a0fa929e1b024d24966cf6da1840000cfa40',
|
|
9
|
+
'name' => '__root__',
|
|
10
10
|
'dev' => true,
|
|
11
11
|
),
|
|
12
12
|
'versions' => array(
|
|
13
13
|
'__root__' => array(
|
|
14
14
|
'pretty_version' => 'dev-main',
|
|
15
15
|
'version' => 'dev-main',
|
|
16
|
-
'reference' => '4b13b1e1b01461c4060434ea2362d03de525c3ea',
|
|
17
16
|
'type' => 'library',
|
|
18
17
|
'install_path' => __DIR__ . '/../../',
|
|
19
18
|
'aliases' => array(),
|
|
19
|
+
'reference' => '9a94a0fa929e1b024d24966cf6da1840000cfa40',
|
|
20
20
|
'dev_requirement' => false,
|
|
21
21
|
),
|
|
22
22
|
'latte/latte' => array(
|
|
23
|
-
'pretty_version' => 'v3.0.
|
|
24
|
-
'version' => '3.0.
|
|
25
|
-
'reference' => '1eee22c760ab8d028e2c21f87fbb7ef7bfeaa0b5',
|
|
23
|
+
'pretty_version' => 'v3.0.2',
|
|
24
|
+
'version' => '3.0.2.0',
|
|
26
25
|
'type' => 'library',
|
|
27
26
|
'install_path' => __DIR__ . '/../latte/latte',
|
|
28
27
|
'aliases' => array(),
|
|
28
|
+
'reference' => 'c3eee2e4e2c21cdf9f9c158c4bfa6150625457e1',
|
|
29
29
|
'dev_requirement' => false,
|
|
30
30
|
),
|
|
31
31
|
),
|
|
@@ -20,25 +20,16 @@ class FunctionCallNode extends ExpressionNode
|
|
|
20
20
|
{
|
|
21
21
|
public function __construct(
|
|
22
22
|
public NameNode|ExpressionNode $name,
|
|
23
|
-
/** @var array<Php\ArgumentNode
|
|
23
|
+
/** @var array<Php\ArgumentNode> */
|
|
24
24
|
public array $args = [],
|
|
25
25
|
public ?Position $position = null,
|
|
26
26
|
) {
|
|
27
|
-
(function (Php\ArgumentNode
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
public function isFirstClassCallable(): bool
|
|
32
|
-
{
|
|
33
|
-
return ($this->args[0] ?? null) instanceof Php\VariadicPlaceholderNode;
|
|
27
|
+
(function (Php\ArgumentNode ...$args) {})(...$args);
|
|
34
28
|
}
|
|
35
29
|
|
|
36
30
|
|
|
37
31
|
public function print(PrintContext $context): string
|
|
38
32
|
{
|
|
39
|
-
if (PHP_VERSION_ID < 80100 && $this->isFirstClassCallable()) {
|
|
40
|
-
return $context->memberAsString($this->name);
|
|
41
|
-
}
|
|
42
33
|
return $context->callExpr($this->name)
|
|
43
34
|
. '(' . $context->implode($this->args) . ')';
|
|
44
35
|
}
|
|
@@ -10,17 +10,15 @@ declare(strict_types=1);
|
|
|
10
10
|
namespace Latte\Compiler\Nodes\Php\Expression;
|
|
11
11
|
|
|
12
12
|
use Latte\Compiler\Nodes\Php\ExpressionNode;
|
|
13
|
-
use Latte\Compiler\Nodes\Php\
|
|
14
|
-
use Latte\Compiler\Nodes\Php\Scalar\NullNode;
|
|
13
|
+
use Latte\Compiler\Nodes\Php\NameNode;
|
|
15
14
|
use Latte\Compiler\Position;
|
|
16
15
|
use Latte\Compiler\PrintContext;
|
|
17
16
|
|
|
18
17
|
|
|
19
|
-
class
|
|
18
|
+
class FunctionCallableNode extends ExpressionNode
|
|
20
19
|
{
|
|
21
20
|
public function __construct(
|
|
22
|
-
public ExpressionNode $
|
|
23
|
-
public IdentifierNode|ExpressionNode $name,
|
|
21
|
+
public NameNode|ExpressionNode $name,
|
|
24
22
|
public ?Position $position = null,
|
|
25
23
|
) {
|
|
26
24
|
}
|
|
@@ -28,15 +26,14 @@ class UndefinedsafePropertyFetchNode extends ExpressionNode
|
|
|
28
26
|
|
|
29
27
|
public function print(PrintContext $context): string
|
|
30
28
|
{
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
return PHP_VERSION_ID < 80100
|
|
30
|
+
? $context->memberAsString($this->name)
|
|
31
|
+
: $context->callExpr($this->name) . '(...)';
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
|
|
37
35
|
public function &getIterator(): \Generator
|
|
38
36
|
{
|
|
39
|
-
yield $this->object;
|
|
40
37
|
yield $this->name;
|
|
41
38
|
}
|
|
42
39
|
}
|
|
@@ -21,28 +21,19 @@ class MethodCallNode extends ExpressionNode
|
|
|
21
21
|
public function __construct(
|
|
22
22
|
public ExpressionNode $object,
|
|
23
23
|
public IdentifierNode|ExpressionNode $name,
|
|
24
|
-
/** @var array<Php\ArgumentNode
|
|
24
|
+
/** @var array<Php\ArgumentNode> */
|
|
25
25
|
public array $args = [],
|
|
26
|
+
public bool $nullsafe = false,
|
|
26
27
|
public ?Position $position = null,
|
|
27
28
|
) {
|
|
28
|
-
(function (Php\ArgumentNode
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
public function isFirstClassCallable(): bool
|
|
33
|
-
{
|
|
34
|
-
return ($this->args[0] ?? null) instanceof Php\VariadicPlaceholderNode;
|
|
29
|
+
(function (Php\ArgumentNode ...$args) {})(...$args);
|
|
35
30
|
}
|
|
36
31
|
|
|
37
32
|
|
|
38
33
|
public function print(PrintContext $context): string
|
|
39
34
|
{
|
|
40
|
-
if (PHP_VERSION_ID < 80100 && $this->isFirstClassCallable()) {
|
|
41
|
-
return '[' . $this->object->print($context) . ', ' . $context->memberAsString($this->name) . ']';
|
|
42
|
-
}
|
|
43
|
-
|
|
44
35
|
return $context->dereferenceExpr($this->object)
|
|
45
|
-
. '->'
|
|
36
|
+
. ($this->nullsafe ? '?->' : '->')
|
|
46
37
|
. $context->objectProperty($this->name)
|
|
47
38
|
. '(' . $context->implode($this->args) . ')';
|
|
48
39
|
}
|
|
@@ -15,7 +15,7 @@ use Latte\Compiler\Position;
|
|
|
15
15
|
use Latte\Compiler\PrintContext;
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
class
|
|
18
|
+
class MethodCallableNode extends ExpressionNode
|
|
19
19
|
{
|
|
20
20
|
public function __construct(
|
|
21
21
|
public ExpressionNode $object,
|
|
@@ -27,9 +27,10 @@ class NullsafePropertyFetchNode extends ExpressionNode
|
|
|
27
27
|
|
|
28
28
|
public function print(PrintContext $context): string
|
|
29
29
|
{
|
|
30
|
-
return
|
|
31
|
-
. '
|
|
32
|
-
|
|
30
|
+
return PHP_VERSION_ID < 80100
|
|
31
|
+
? '[' . $this->object->print($context) . ', ' . $context->memberAsString($this->name) . ']'
|
|
32
|
+
: $context->dereferenceExpr($this->object)
|
|
33
|
+
. '->' . $context->objectProperty($this->name) . '(...)';
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
|
|
@@ -20,6 +20,7 @@ class PropertyFetchNode extends ExpressionNode
|
|
|
20
20
|
public function __construct(
|
|
21
21
|
public ExpressionNode $object,
|
|
22
22
|
public IdentifierNode|ExpressionNode $name,
|
|
23
|
+
public bool $nullsafe = false,
|
|
23
24
|
public ?Position $position = null,
|
|
24
25
|
) {
|
|
25
26
|
}
|
|
@@ -28,7 +29,7 @@ class PropertyFetchNode extends ExpressionNode
|
|
|
28
29
|
public function print(PrintContext $context): string
|
|
29
30
|
{
|
|
30
31
|
return $context->dereferenceExpr($this->object)
|
|
31
|
-
. '->'
|
|
32
|
+
. ($this->nullsafe ? '?->' : '->')
|
|
32
33
|
. $context->objectProperty($this->name);
|
|
33
34
|
}
|
|
34
35
|
|
|
@@ -22,26 +22,16 @@ class StaticCallNode extends ExpressionNode
|
|
|
22
22
|
public function __construct(
|
|
23
23
|
public NameNode|ExpressionNode $class,
|
|
24
24
|
public IdentifierNode|ExpressionNode $name,
|
|
25
|
-
/** @var array<Php\ArgumentNode
|
|
25
|
+
/** @var array<Php\ArgumentNode> */
|
|
26
26
|
public array $args = [],
|
|
27
27
|
public ?Position $position = null,
|
|
28
28
|
) {
|
|
29
|
-
(function (Php\ArgumentNode
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
public function isFirstClassCallable(): bool
|
|
34
|
-
{
|
|
35
|
-
return ($this->args[0] ?? null) instanceof Php\VariadicPlaceholderNode;
|
|
29
|
+
(function (Php\ArgumentNode ...$args) {})(...$args);
|
|
36
30
|
}
|
|
37
31
|
|
|
38
32
|
|
|
39
33
|
public function print(PrintContext $context): string
|
|
40
34
|
{
|
|
41
|
-
if (PHP_VERSION_ID < 80100 && $this->isFirstClassCallable()) {
|
|
42
|
-
return '[' . $this->class->print($context) . ', ' . $context->memberAsString($this->name) . ']';
|
|
43
|
-
}
|
|
44
|
-
|
|
45
35
|
$name = match (true) {
|
|
46
36
|
$this->name instanceof VariableNode => $this->name->print($context),
|
|
47
37
|
$this->name instanceof ExpressionNode => '{' . $this->name->print($context) . '}',
|