@vituum/vite-plugin-latte 0.1.14 → 0.1.15
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 +2 -4
- package/package.json +5 -5
- package/vendor/autoload.php +6 -1
- package/vendor/bin/latte-lint +14 -1
- package/vendor/composer/InstalledVersions.php +9 -7
- package/vendor/composer/autoload_classmap.php +10 -7
- package/vendor/composer/autoload_namespaces.php +1 -1
- package/vendor/composer/autoload_psr4.php +1 -1
- package/vendor/composer/autoload_real.php +7 -26
- package/vendor/composer/autoload_static.php +11 -8
- 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 +11 -2
- package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/MethodCallNode.php +13 -4
- package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/{StaticCallableNode.php → NullsafeMethodCallNode.php} +14 -12
- package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/{MethodCallableNode.php → NullsafePropertyFetchNode.php} +4 -5
- package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/PropertyFetchNode.php +1 -2
- package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/StaticCallNode.php +12 -2
- package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/UndefinedsafeMethodCallNode.php +49 -0
- package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/{FunctionCallableNode.php → UndefinedsafePropertyFetchNode.php} +9 -6
- package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/Scalar/EncapsedStringNode.php +6 -8
- package/vendor/latte/latte/src/Latte/Compiler/Nodes/Php/VariadicPlaceholderNode.php +29 -0
- package/vendor/latte/latte/src/Latte/Compiler/PrintContext.php +3 -6
- package/vendor/latte/latte/src/Latte/Compiler/TagLexer.php +6 -23
- package/vendor/latte/latte/src/Latte/Compiler/TagParser.php +0 -87
- package/vendor/latte/latte/src/Latte/Compiler/TagParserData.php +285 -306
- package/vendor/latte/latte/src/Latte/Compiler/TemplateLexer.php +43 -31
- package/vendor/latte/latte/src/Latte/Compiler/Token.php +13 -17
- package/vendor/latte/latte/src/Latte/Engine.php +2 -2
- package/vendor/latte/latte/src/Latte/Essential/CoreExtension.php +2 -4
- 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 +5 -0
- package/vendor/latte/latte/src/Latte/Sandbox/Nodes/MethodCallNode.php +8 -3
- package/vendor/latte/latte/src/Latte/Sandbox/Nodes/NullsafeMethodCallNode.php +31 -0
- package/vendor/latte/latte/src/Latte/Sandbox/Nodes/{MethodCallableNode.php → NullsafePropertyFetchNode.php} +6 -4
- package/vendor/latte/latte/src/Latte/Sandbox/Nodes/PropertyFetchNode.php +2 -2
- package/vendor/latte/latte/src/Latte/Sandbox/Nodes/StaticCallNode.php +6 -0
- package/vendor/latte/latte/src/Latte/Sandbox/Nodes/UndefinedsafeMethodCallNode.php +31 -0
- package/vendor/latte/latte/src/Latte/Sandbox/Nodes/UndefinedsafePropertyFetchNode.php +32 -0
- package/vendor/latte/latte/src/Latte/Sandbox/SandboxExtension.php +5 -3
- package/vendor/latte/latte/src/Latte/Sandbox/Nodes/FunctionCallableNode.php +0 -29
- package/vendor/latte/latte/src/Latte/Sandbox/Nodes/StaticCallableNode.php +0 -30
package/index.js
CHANGED
|
@@ -126,15 +126,13 @@ const latte = (params = {}) => {
|
|
|
126
126
|
|
|
127
127
|
const message = warningLog ? 'Warning: Undefined' + renderLatte.output.split('Warning: Undefined').pop() : renderLatte.output
|
|
128
128
|
|
|
129
|
-
server.ws.send({
|
|
129
|
+
setTimeout(() => server.ws.send({
|
|
130
130
|
type: 'error',
|
|
131
131
|
err: {
|
|
132
132
|
message,
|
|
133
133
|
plugin: '@vituum/vite-plugin-latte'
|
|
134
134
|
}
|
|
135
|
-
})
|
|
136
|
-
|
|
137
|
-
return
|
|
135
|
+
}), 50)
|
|
138
136
|
}
|
|
139
137
|
|
|
140
138
|
return renderLatte.output
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vituum/vite-plugin-latte",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"preview": "vite preview"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"fast-glob": "^3.2.
|
|
12
|
+
"fast-glob": "^3.2.12",
|
|
13
13
|
"lodash": "^4.17.21",
|
|
14
|
-
"chalk": "^5.0
|
|
14
|
+
"chalk": "^5.2.0"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"vite": "^
|
|
18
|
-
"eslint": "^8.
|
|
17
|
+
"vite": "^4.0.0",
|
|
18
|
+
"eslint": "^8.29.0",
|
|
19
19
|
"eslint-config-standard": "^17.0.0"
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
package/vendor/autoload.php
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
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
|
+
|
|
5
10
|
require_once __DIR__ . '/composer/autoload_real.php';
|
|
6
11
|
|
|
7
|
-
return
|
|
12
|
+
return ComposerAutoloaderInitda1ce49ef3085539a79eddbb995629f3::getLoader();
|
package/vendor/bin/latte-lint
CHANGED
|
@@ -66,6 +66,16 @@ 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
|
+
|
|
69
79
|
public function stream_tell()
|
|
70
80
|
{
|
|
71
81
|
return $this->position;
|
|
@@ -98,7 +108,10 @@ if (PHP_VERSION_ID < 80000) {
|
|
|
98
108
|
}
|
|
99
109
|
}
|
|
100
110
|
|
|
101
|
-
if (
|
|
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
|
+
) {
|
|
102
115
|
include("phpvfscomposer://" . __DIR__ . '/..'.'/latte/latte/bin/latte-lint');
|
|
103
116
|
exit(0);
|
|
104
117
|
}
|
|
@@ -21,12 +21,14 @@ 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
|
|
24
26
|
*/
|
|
25
27
|
class InstalledVersions
|
|
26
28
|
{
|
|
27
29
|
/**
|
|
28
30
|
* @var mixed[]|null
|
|
29
|
-
* @psalm-var array{root: array{name: string,
|
|
31
|
+
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
|
|
30
32
|
*/
|
|
31
33
|
private static $installed;
|
|
32
34
|
|
|
@@ -37,7 +39,7 @@ class InstalledVersions
|
|
|
37
39
|
|
|
38
40
|
/**
|
|
39
41
|
* @var array[]
|
|
40
|
-
* @psalm-var array<string, array{root: array{name: string,
|
|
42
|
+
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
|
41
43
|
*/
|
|
42
44
|
private static $installedByVendor = array();
|
|
43
45
|
|
|
@@ -241,7 +243,7 @@ class InstalledVersions
|
|
|
241
243
|
|
|
242
244
|
/**
|
|
243
245
|
* @return array
|
|
244
|
-
* @psalm-return array{name: string,
|
|
246
|
+
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
|
|
245
247
|
*/
|
|
246
248
|
public static function getRootPackage()
|
|
247
249
|
{
|
|
@@ -255,7 +257,7 @@ class InstalledVersions
|
|
|
255
257
|
*
|
|
256
258
|
* @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.
|
|
257
259
|
* @return array[]
|
|
258
|
-
* @psalm-return array{root: array{name: string,
|
|
260
|
+
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
|
|
259
261
|
*/
|
|
260
262
|
public static function getRawData()
|
|
261
263
|
{
|
|
@@ -278,7 +280,7 @@ class InstalledVersions
|
|
|
278
280
|
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
|
279
281
|
*
|
|
280
282
|
* @return array[]
|
|
281
|
-
* @psalm-return list<array{root: array{name: string,
|
|
283
|
+
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
|
282
284
|
*/
|
|
283
285
|
public static function getAllRawData()
|
|
284
286
|
{
|
|
@@ -301,7 +303,7 @@ class InstalledVersions
|
|
|
301
303
|
* @param array[] $data A vendor/composer/installed.php data set
|
|
302
304
|
* @return void
|
|
303
305
|
*
|
|
304
|
-
* @psalm-param array{root: array{name: string,
|
|
306
|
+
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
|
|
305
307
|
*/
|
|
306
308
|
public static function reload($data)
|
|
307
309
|
{
|
|
@@ -311,7 +313,7 @@ class InstalledVersions
|
|
|
311
313
|
|
|
312
314
|
/**
|
|
313
315
|
* @return array[]
|
|
314
|
-
* @psalm-return list<array{root: array{name: string,
|
|
316
|
+
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
|
315
317
|
*/
|
|
316
318
|
private static function getInstalled()
|
|
317
319
|
{
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// autoload_classmap.php @generated by Composer
|
|
4
4
|
|
|
5
|
-
$vendorDir = dirname(
|
|
5
|
+
$vendorDir = dirname(__DIR__);
|
|
6
6
|
$baseDir = dirname($vendorDir);
|
|
7
7
|
|
|
8
8
|
return array(
|
|
@@ -46,23 +46,24 @@ 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',
|
|
50
49
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\InRangeNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/InRangeNode.php',
|
|
51
50
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\InstanceofNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/InstanceofNode.php',
|
|
52
51
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\IssetNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/IssetNode.php',
|
|
53
52
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\MatchNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/MatchNode.php',
|
|
54
53
|
'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',
|
|
56
54
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\NewNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/NewNode.php',
|
|
57
55
|
'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',
|
|
63
62
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\StaticPropertyFetchNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/StaticPropertyFetchNode.php',
|
|
64
63
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\TernaryNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/TernaryNode.php',
|
|
65
64
|
'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',
|
|
66
67
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\VariableNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/VariableNode.php',
|
|
67
68
|
'Latte\\Compiler\\Nodes\\Php\\FilterNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/FilterNode.php',
|
|
68
69
|
'Latte\\Compiler\\Nodes\\Php\\IdentifierNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/IdentifierNode.php',
|
|
@@ -83,6 +84,7 @@ return array(
|
|
|
83
84
|
'Latte\\Compiler\\Nodes\\Php\\SuperiorTypeNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/SuperiorTypeNode.php',
|
|
84
85
|
'Latte\\Compiler\\Nodes\\Php\\UnionTypeNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/Php/UnionTypeNode.php',
|
|
85
86
|
'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',
|
|
86
88
|
'Latte\\Compiler\\Nodes\\StatementNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/StatementNode.php',
|
|
87
89
|
'Latte\\Compiler\\Nodes\\TemplateNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/TemplateNode.php',
|
|
88
90
|
'Latte\\Compiler\\Nodes\\TextNode' => $vendorDir . '/latte/latte/src/Latte/Compiler/Nodes/TextNode.php',
|
|
@@ -166,14 +168,15 @@ return array(
|
|
|
166
168
|
'Latte\\Runtime\\HtmlStringable' => $vendorDir . '/latte/latte/src/Latte/Runtime/HtmlStringable.php',
|
|
167
169
|
'Latte\\Runtime\\Template' => $vendorDir . '/latte/latte/src/Latte/Runtime/Template.php',
|
|
168
170
|
'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',
|
|
170
171
|
'Latte\\Sandbox\\Nodes\\MethodCallNode' => $vendorDir . '/latte/latte/src/Latte/Sandbox/Nodes/MethodCallNode.php',
|
|
171
|
-
'Latte\\Sandbox\\Nodes\\
|
|
172
|
+
'Latte\\Sandbox\\Nodes\\NullsafeMethodCallNode' => $vendorDir . '/latte/latte/src/Latte/Sandbox/Nodes/NullsafeMethodCallNode.php',
|
|
173
|
+
'Latte\\Sandbox\\Nodes\\NullsafePropertyFetchNode' => $vendorDir . '/latte/latte/src/Latte/Sandbox/Nodes/NullsafePropertyFetchNode.php',
|
|
172
174
|
'Latte\\Sandbox\\Nodes\\PropertyFetchNode' => $vendorDir . '/latte/latte/src/Latte/Sandbox/Nodes/PropertyFetchNode.php',
|
|
173
175
|
'Latte\\Sandbox\\Nodes\\SandboxNode' => $vendorDir . '/latte/latte/src/Latte/Sandbox/Nodes/SandboxNode.php',
|
|
174
176
|
'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',
|
|
176
177
|
'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',
|
|
177
180
|
'Latte\\Sandbox\\RuntimeChecker' => $vendorDir . '/latte/latte/src/Latte/Sandbox/RuntimeChecker.php',
|
|
178
181
|
'Latte\\Sandbox\\SandboxExtension' => $vendorDir . '/latte/latte/src/Latte/Sandbox/SandboxExtension.php',
|
|
179
182
|
'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 ComposerAutoloaderInitda1ce49ef3085539a79eddbb995629f3
|
|
6
6
|
{
|
|
7
7
|
private static $loader;
|
|
8
8
|
|
|
@@ -24,31 +24,12 @@ class ComposerAutoloaderInit19cfb30b66a778b432af39bbd1e78bca
|
|
|
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
|
-
|
|
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
|
-
}
|
|
27
|
+
spl_autoload_register(array('ComposerAutoloaderInitda1ce49ef3085539a79eddbb995629f3', 'loadClassLoader'), true, true);
|
|
28
|
+
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
|
29
|
+
spl_autoload_unregister(array('ComposerAutoloaderInitda1ce49ef3085539a79eddbb995629f3', 'loadClassLoader'));
|
|
30
|
+
|
|
31
|
+
require __DIR__ . '/autoload_static.php';
|
|
32
|
+
call_user_func(\Composer\Autoload\ComposerStaticInitda1ce49ef3085539a79eddbb995629f3::getInitializer($loader));
|
|
52
33
|
|
|
53
34
|
$loader->register(true);
|
|
54
35
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
namespace Composer\Autoload;
|
|
6
6
|
|
|
7
|
-
class
|
|
7
|
+
class ComposerStaticInitda1ce49ef3085539a79eddbb995629f3
|
|
8
8
|
{
|
|
9
9
|
public static $classMap = array (
|
|
10
10
|
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
|
@@ -47,23 +47,24 @@ class ComposerStaticInit19cfb30b66a778b432af39bbd1e78bca
|
|
|
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',
|
|
51
50
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\InRangeNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/InRangeNode.php',
|
|
52
51
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\InstanceofNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/InstanceofNode.php',
|
|
53
52
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\IssetNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/IssetNode.php',
|
|
54
53
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\MatchNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/MatchNode.php',
|
|
55
54
|
'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',
|
|
57
55
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\NewNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/NewNode.php',
|
|
58
56
|
'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',
|
|
64
63
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\StaticPropertyFetchNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/StaticPropertyFetchNode.php',
|
|
65
64
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\TernaryNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/TernaryNode.php',
|
|
66
65
|
'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',
|
|
67
68
|
'Latte\\Compiler\\Nodes\\Php\\Expression\\VariableNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/Expression/VariableNode.php',
|
|
68
69
|
'Latte\\Compiler\\Nodes\\Php\\FilterNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/FilterNode.php',
|
|
69
70
|
'Latte\\Compiler\\Nodes\\Php\\IdentifierNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/IdentifierNode.php',
|
|
@@ -84,6 +85,7 @@ class ComposerStaticInit19cfb30b66a778b432af39bbd1e78bca
|
|
|
84
85
|
'Latte\\Compiler\\Nodes\\Php\\SuperiorTypeNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/SuperiorTypeNode.php',
|
|
85
86
|
'Latte\\Compiler\\Nodes\\Php\\UnionTypeNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/Php/UnionTypeNode.php',
|
|
86
87
|
'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',
|
|
87
89
|
'Latte\\Compiler\\Nodes\\StatementNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/StatementNode.php',
|
|
88
90
|
'Latte\\Compiler\\Nodes\\TemplateNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/TemplateNode.php',
|
|
89
91
|
'Latte\\Compiler\\Nodes\\TextNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Compiler/Nodes/TextNode.php',
|
|
@@ -167,14 +169,15 @@ class ComposerStaticInit19cfb30b66a778b432af39bbd1e78bca
|
|
|
167
169
|
'Latte\\Runtime\\HtmlStringable' => __DIR__ . '/..' . '/latte/latte/src/Latte/Runtime/HtmlStringable.php',
|
|
168
170
|
'Latte\\Runtime\\Template' => __DIR__ . '/..' . '/latte/latte/src/Latte/Runtime/Template.php',
|
|
169
171
|
'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',
|
|
171
172
|
'Latte\\Sandbox\\Nodes\\MethodCallNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/Nodes/MethodCallNode.php',
|
|
172
|
-
'Latte\\Sandbox\\Nodes\\
|
|
173
|
+
'Latte\\Sandbox\\Nodes\\NullsafeMethodCallNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/Nodes/NullsafeMethodCallNode.php',
|
|
174
|
+
'Latte\\Sandbox\\Nodes\\NullsafePropertyFetchNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/Nodes/NullsafePropertyFetchNode.php',
|
|
173
175
|
'Latte\\Sandbox\\Nodes\\PropertyFetchNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/Nodes/PropertyFetchNode.php',
|
|
174
176
|
'Latte\\Sandbox\\Nodes\\SandboxNode' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/Nodes/SandboxNode.php',
|
|
175
177
|
'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',
|
|
177
178
|
'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',
|
|
178
181
|
'Latte\\Sandbox\\RuntimeChecker' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/RuntimeChecker.php',
|
|
179
182
|
'Latte\\Sandbox\\SandboxExtension' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/SandboxExtension.php',
|
|
180
183
|
'Latte\\Sandbox\\SecurityPolicy' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/SecurityPolicy.php',
|
|
@@ -186,7 +189,7 @@ class ComposerStaticInit19cfb30b66a778b432af39bbd1e78bca
|
|
|
186
189
|
public static function getInitializer(ClassLoader $loader)
|
|
187
190
|
{
|
|
188
191
|
return \Closure::bind(function () use ($loader) {
|
|
189
|
-
$loader->classMap =
|
|
192
|
+
$loader->classMap = ComposerStaticInitda1ce49ef3085539a79eddbb995629f3::$classMap;
|
|
190
193
|
|
|
191
194
|
}, null, ClassLoader::class);
|
|
192
195
|
}
|
|
@@ -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.1",
|
|
6
|
+
"version_normalized": "3.0.1.0",
|
|
7
7
|
"source": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/nette/latte.git",
|
|
10
|
-
"reference": "
|
|
10
|
+
"reference": "1eee22c760ab8d028e2c21f87fbb7ef7bfeaa0b5"
|
|
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/1eee22c760ab8d028e2c21f87fbb7ef7bfeaa0b5",
|
|
15
|
+
"reference": "1eee22c760ab8d028e2c21f87fbb7ef7bfeaa0b5",
|
|
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-01T12:19:53+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.1"
|
|
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__',
|
|
3
4
|
'pretty_version' => 'dev-main',
|
|
4
5
|
'version' => 'dev-main',
|
|
6
|
+
'reference' => '4b13b1e1b01461c4060434ea2362d03de525c3ea',
|
|
5
7
|
'type' => 'library',
|
|
6
8
|
'install_path' => __DIR__ . '/../../',
|
|
7
9
|
'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',
|
|
16
17
|
'type' => 'library',
|
|
17
18
|
'install_path' => __DIR__ . '/../../',
|
|
18
19
|
'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.
|
|
23
|
+
'pretty_version' => 'v3.0.1',
|
|
24
|
+
'version' => '3.0.1.0',
|
|
25
|
+
'reference' => '1eee22c760ab8d028e2c21f87fbb7ef7bfeaa0b5',
|
|
25
26
|
'type' => 'library',
|
|
26
27
|
'install_path' => __DIR__ . '/../latte/latte',
|
|
27
28
|
'aliases' => array(),
|
|
28
|
-
'reference' => 'c3eee2e4e2c21cdf9f9c158c4bfa6150625457e1',
|
|
29
29
|
'dev_requirement' => false,
|
|
30
30
|
),
|
|
31
31
|
),
|
|
@@ -20,16 +20,25 @@ 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|Php\VariadicPlaceholderNode> */
|
|
24
24
|
public array $args = [],
|
|
25
25
|
public ?Position $position = null,
|
|
26
26
|
) {
|
|
27
|
-
(function (Php\ArgumentNode ...$args) {})(...$args);
|
|
27
|
+
(function (Php\ArgumentNode|Php\VariadicPlaceholderNode ...$args) {})(...$args);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
public function isFirstClassCallable(): bool
|
|
32
|
+
{
|
|
33
|
+
return ($this->args[0] ?? null) instanceof Php\VariadicPlaceholderNode;
|
|
28
34
|
}
|
|
29
35
|
|
|
30
36
|
|
|
31
37
|
public function print(PrintContext $context): string
|
|
32
38
|
{
|
|
39
|
+
if (PHP_VERSION_ID < 80100 && $this->isFirstClassCallable()) {
|
|
40
|
+
return $context->memberAsString($this->name);
|
|
41
|
+
}
|
|
33
42
|
return $context->callExpr($this->name)
|
|
34
43
|
. '(' . $context->implode($this->args) . ')';
|
|
35
44
|
}
|
|
@@ -21,19 +21,28 @@ 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|Php\VariadicPlaceholderNode> */
|
|
25
25
|
public array $args = [],
|
|
26
|
-
public bool $nullsafe = false,
|
|
27
26
|
public ?Position $position = null,
|
|
28
27
|
) {
|
|
29
|
-
(function (Php\ArgumentNode ...$args) {})(...$args);
|
|
28
|
+
(function (Php\ArgumentNode|Php\VariadicPlaceholderNode ...$args) {})(...$args);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
public function isFirstClassCallable(): bool
|
|
33
|
+
{
|
|
34
|
+
return ($this->args[0] ?? null) instanceof Php\VariadicPlaceholderNode;
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
|
|
33
38
|
public function print(PrintContext $context): string
|
|
34
39
|
{
|
|
40
|
+
if (PHP_VERSION_ID < 80100 && $this->isFirstClassCallable()) {
|
|
41
|
+
return '[' . $this->object->print($context) . ', ' . $context->memberAsString($this->name) . ']';
|
|
42
|
+
}
|
|
43
|
+
|
|
35
44
|
return $context->dereferenceExpr($this->object)
|
|
36
|
-
.
|
|
45
|
+
. '->'
|
|
37
46
|
. $context->objectProperty($this->name)
|
|
38
47
|
. '(' . $context->implode($this->args) . ')';
|
|
39
48
|
}
|
|
@@ -9,39 +9,41 @@ declare(strict_types=1);
|
|
|
9
9
|
|
|
10
10
|
namespace Latte\Compiler\Nodes\Php\Expression;
|
|
11
11
|
|
|
12
|
+
use Latte\Compiler\Nodes\Php;
|
|
12
13
|
use Latte\Compiler\Nodes\Php\ExpressionNode;
|
|
13
14
|
use Latte\Compiler\Nodes\Php\IdentifierNode;
|
|
14
|
-
use Latte\Compiler\Nodes\Php\NameNode;
|
|
15
15
|
use Latte\Compiler\Position;
|
|
16
16
|
use Latte\Compiler\PrintContext;
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
class
|
|
19
|
+
class NullsafeMethodCallNode extends ExpressionNode
|
|
20
20
|
{
|
|
21
21
|
public function __construct(
|
|
22
|
-
public
|
|
22
|
+
public ExpressionNode $object,
|
|
23
23
|
public IdentifierNode|ExpressionNode $name,
|
|
24
|
+
/** @var array<Php\ArgumentNode> */
|
|
25
|
+
public array $args = [],
|
|
24
26
|
public ?Position $position = null,
|
|
25
27
|
) {
|
|
28
|
+
(function (Php\ArgumentNode ...$args) {})(...$args);
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
|
|
29
32
|
public function print(PrintContext $context): string
|
|
30
33
|
{
|
|
31
|
-
$
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
return PHP_VERSION_ID < 80100
|
|
37
|
-
? '[' . $this->class->print($context) . ', ' . $context->memberAsString($this->name) . ']'
|
|
38
|
-
: $context->dereferenceExpr($this->class) . '::' . $name . '(...)';
|
|
34
|
+
return $context->dereferenceExpr($this->object)
|
|
35
|
+
. '?->'
|
|
36
|
+
. $context->objectProperty($this->name)
|
|
37
|
+
. '(' . $context->implode($this->args) . ')';
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
|
|
42
41
|
public function &getIterator(): \Generator
|
|
43
42
|
{
|
|
44
|
-
yield $this->
|
|
43
|
+
yield $this->object;
|
|
45
44
|
yield $this->name;
|
|
45
|
+
foreach ($this->args as &$item) {
|
|
46
|
+
yield $item;
|
|
47
|
+
}
|
|
46
48
|
}
|
|
47
49
|
}
|
|
@@ -15,7 +15,7 @@ use Latte\Compiler\Position;
|
|
|
15
15
|
use Latte\Compiler\PrintContext;
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
class
|
|
18
|
+
class NullsafePropertyFetchNode extends ExpressionNode
|
|
19
19
|
{
|
|
20
20
|
public function __construct(
|
|
21
21
|
public ExpressionNode $object,
|
|
@@ -27,10 +27,9 @@ class MethodCallableNode extends ExpressionNode
|
|
|
27
27
|
|
|
28
28
|
public function print(PrintContext $context): string
|
|
29
29
|
{
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
. '->' . $context->objectProperty($this->name) . '(...)';
|
|
30
|
+
return $context->dereferenceExpr($this->object)
|
|
31
|
+
. '?->'
|
|
32
|
+
. $context->objectProperty($this->name);
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
|
|
@@ -20,7 +20,6 @@ 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,
|
|
24
23
|
public ?Position $position = null,
|
|
25
24
|
) {
|
|
26
25
|
}
|
|
@@ -29,7 +28,7 @@ class PropertyFetchNode extends ExpressionNode
|
|
|
29
28
|
public function print(PrintContext $context): string
|
|
30
29
|
{
|
|
31
30
|
return $context->dereferenceExpr($this->object)
|
|
32
|
-
.
|
|
31
|
+
. '->'
|
|
33
32
|
. $context->objectProperty($this->name);
|
|
34
33
|
}
|
|
35
34
|
|