@vituum/vite-plugin-latte 1.2.0 → 1.2.1

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.
Files changed (42) hide show
  1. package/package.json +1 -1
  2. package/vendor/composer/autoload_classmap.php +49 -0
  3. package/vendor/composer/autoload_static.php +49 -0
  4. package/vendor/composer/installed.json +89 -0
  5. package/vendor/composer/installed.php +11 -2
  6. package/vendor/nette/utils/.phpstorm.meta.php +13 -0
  7. package/vendor/nette/utils/composer.json +51 -0
  8. package/vendor/nette/utils/license.md +60 -0
  9. package/vendor/nette/utils/readme.md +56 -0
  10. package/vendor/nette/utils/src/HtmlStringable.php +22 -0
  11. package/vendor/nette/utils/src/Iterators/CachingIterator.php +164 -0
  12. package/vendor/nette/utils/src/Iterators/Mapper.php +34 -0
  13. package/vendor/nette/utils/src/SmartObject.php +140 -0
  14. package/vendor/nette/utils/src/StaticClass.php +34 -0
  15. package/vendor/nette/utils/src/Translator.php +25 -0
  16. package/vendor/nette/utils/src/Utils/ArrayHash.php +106 -0
  17. package/vendor/nette/utils/src/Utils/ArrayList.php +136 -0
  18. package/vendor/nette/utils/src/Utils/Arrays.php +522 -0
  19. package/vendor/nette/utils/src/Utils/Callback.php +137 -0
  20. package/vendor/nette/utils/src/Utils/DateTime.php +140 -0
  21. package/vendor/nette/utils/src/Utils/FileInfo.php +69 -0
  22. package/vendor/nette/utils/src/Utils/FileSystem.php +326 -0
  23. package/vendor/nette/utils/src/Utils/Finder.php +510 -0
  24. package/vendor/nette/utils/src/Utils/Floats.php +107 -0
  25. package/vendor/nette/utils/src/Utils/Helpers.php +104 -0
  26. package/vendor/nette/utils/src/Utils/Html.php +839 -0
  27. package/vendor/nette/utils/src/Utils/Image.php +829 -0
  28. package/vendor/nette/utils/src/Utils/ImageColor.php +75 -0
  29. package/vendor/nette/utils/src/Utils/ImageType.php +25 -0
  30. package/vendor/nette/utils/src/Utils/Iterables.php +159 -0
  31. package/vendor/nette/utils/src/Utils/Json.php +84 -0
  32. package/vendor/nette/utils/src/Utils/ObjectHelpers.php +229 -0
  33. package/vendor/nette/utils/src/Utils/Paginator.php +245 -0
  34. package/vendor/nette/utils/src/Utils/Random.php +52 -0
  35. package/vendor/nette/utils/src/Utils/Reflection.php +320 -0
  36. package/vendor/nette/utils/src/Utils/ReflectionMethod.php +36 -0
  37. package/vendor/nette/utils/src/Utils/Strings.php +708 -0
  38. package/vendor/nette/utils/src/Utils/Type.php +267 -0
  39. package/vendor/nette/utils/src/Utils/Validators.php +416 -0
  40. package/vendor/nette/utils/src/Utils/exceptions.php +50 -0
  41. package/vendor/nette/utils/src/compatibility.php +32 -0
  42. package/vendor/nette/utils/src/exceptions.php +109 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vituum/vite-plugin-latte",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",
@@ -188,4 +188,53 @@ return array(
188
188
  'Latte\\Sandbox\\SecurityPolicy' => $vendorDir . '/latte/latte/src/Latte/Sandbox/SecurityPolicy.php',
189
189
  'Latte\\SecurityViolationException' => $vendorDir . '/latte/latte/src/Latte/exceptions.php',
190
190
  'Latte\\Tools\\Linter' => $vendorDir . '/latte/latte/src/Tools/Linter.php',
191
+ 'Nette\\ArgumentOutOfRangeException' => $vendorDir . '/nette/utils/src/exceptions.php',
192
+ 'Nette\\DeprecatedException' => $vendorDir . '/nette/utils/src/exceptions.php',
193
+ 'Nette\\DirectoryNotFoundException' => $vendorDir . '/nette/utils/src/exceptions.php',
194
+ 'Nette\\FileNotFoundException' => $vendorDir . '/nette/utils/src/exceptions.php',
195
+ 'Nette\\HtmlStringable' => $vendorDir . '/nette/utils/src/HtmlStringable.php',
196
+ 'Nette\\IOException' => $vendorDir . '/nette/utils/src/exceptions.php',
197
+ 'Nette\\InvalidArgumentException' => $vendorDir . '/nette/utils/src/exceptions.php',
198
+ 'Nette\\InvalidStateException' => $vendorDir . '/nette/utils/src/exceptions.php',
199
+ 'Nette\\Iterators\\CachingIterator' => $vendorDir . '/nette/utils/src/Iterators/CachingIterator.php',
200
+ 'Nette\\Iterators\\Mapper' => $vendorDir . '/nette/utils/src/Iterators/Mapper.php',
201
+ 'Nette\\Localization\\ITranslator' => $vendorDir . '/nette/utils/src/compatibility.php',
202
+ 'Nette\\Localization\\Translator' => $vendorDir . '/nette/utils/src/Translator.php',
203
+ 'Nette\\MemberAccessException' => $vendorDir . '/nette/utils/src/exceptions.php',
204
+ 'Nette\\NotImplementedException' => $vendorDir . '/nette/utils/src/exceptions.php',
205
+ 'Nette\\NotSupportedException' => $vendorDir . '/nette/utils/src/exceptions.php',
206
+ 'Nette\\OutOfRangeException' => $vendorDir . '/nette/utils/src/exceptions.php',
207
+ 'Nette\\SmartObject' => $vendorDir . '/nette/utils/src/SmartObject.php',
208
+ 'Nette\\StaticClass' => $vendorDir . '/nette/utils/src/StaticClass.php',
209
+ 'Nette\\UnexpectedValueException' => $vendorDir . '/nette/utils/src/exceptions.php',
210
+ 'Nette\\Utils\\ArrayHash' => $vendorDir . '/nette/utils/src/Utils/ArrayHash.php',
211
+ 'Nette\\Utils\\ArrayList' => $vendorDir . '/nette/utils/src/Utils/ArrayList.php',
212
+ 'Nette\\Utils\\Arrays' => $vendorDir . '/nette/utils/src/Utils/Arrays.php',
213
+ 'Nette\\Utils\\AssertionException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php',
214
+ 'Nette\\Utils\\Callback' => $vendorDir . '/nette/utils/src/Utils/Callback.php',
215
+ 'Nette\\Utils\\DateTime' => $vendorDir . '/nette/utils/src/Utils/DateTime.php',
216
+ 'Nette\\Utils\\FileInfo' => $vendorDir . '/nette/utils/src/Utils/FileInfo.php',
217
+ 'Nette\\Utils\\FileSystem' => $vendorDir . '/nette/utils/src/Utils/FileSystem.php',
218
+ 'Nette\\Utils\\Finder' => $vendorDir . '/nette/utils/src/Utils/Finder.php',
219
+ 'Nette\\Utils\\Floats' => $vendorDir . '/nette/utils/src/Utils/Floats.php',
220
+ 'Nette\\Utils\\Helpers' => $vendorDir . '/nette/utils/src/Utils/Helpers.php',
221
+ 'Nette\\Utils\\Html' => $vendorDir . '/nette/utils/src/Utils/Html.php',
222
+ 'Nette\\Utils\\IHtmlString' => $vendorDir . '/nette/utils/src/compatibility.php',
223
+ 'Nette\\Utils\\Image' => $vendorDir . '/nette/utils/src/Utils/Image.php',
224
+ 'Nette\\Utils\\ImageColor' => $vendorDir . '/nette/utils/src/Utils/ImageColor.php',
225
+ 'Nette\\Utils\\ImageException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php',
226
+ 'Nette\\Utils\\ImageType' => $vendorDir . '/nette/utils/src/Utils/ImageType.php',
227
+ 'Nette\\Utils\\Iterables' => $vendorDir . '/nette/utils/src/Utils/Iterables.php',
228
+ 'Nette\\Utils\\Json' => $vendorDir . '/nette/utils/src/Utils/Json.php',
229
+ 'Nette\\Utils\\JsonException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php',
230
+ 'Nette\\Utils\\ObjectHelpers' => $vendorDir . '/nette/utils/src/Utils/ObjectHelpers.php',
231
+ 'Nette\\Utils\\Paginator' => $vendorDir . '/nette/utils/src/Utils/Paginator.php',
232
+ 'Nette\\Utils\\Random' => $vendorDir . '/nette/utils/src/Utils/Random.php',
233
+ 'Nette\\Utils\\Reflection' => $vendorDir . '/nette/utils/src/Utils/Reflection.php',
234
+ 'Nette\\Utils\\ReflectionMethod' => $vendorDir . '/nette/utils/src/Utils/ReflectionMethod.php',
235
+ 'Nette\\Utils\\RegexpException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php',
236
+ 'Nette\\Utils\\Strings' => $vendorDir . '/nette/utils/src/Utils/Strings.php',
237
+ 'Nette\\Utils\\Type' => $vendorDir . '/nette/utils/src/Utils/Type.php',
238
+ 'Nette\\Utils\\UnknownImageFileException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php',
239
+ 'Nette\\Utils\\Validators' => $vendorDir . '/nette/utils/src/Utils/Validators.php',
191
240
  );
@@ -189,6 +189,55 @@ class ComposerStaticInit19cfb30b66a778b432af39bbd1e78bca
189
189
  'Latte\\Sandbox\\SecurityPolicy' => __DIR__ . '/..' . '/latte/latte/src/Latte/Sandbox/SecurityPolicy.php',
190
190
  'Latte\\SecurityViolationException' => __DIR__ . '/..' . '/latte/latte/src/Latte/exceptions.php',
191
191
  'Latte\\Tools\\Linter' => __DIR__ . '/..' . '/latte/latte/src/Tools/Linter.php',
192
+ 'Nette\\ArgumentOutOfRangeException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php',
193
+ 'Nette\\DeprecatedException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php',
194
+ 'Nette\\DirectoryNotFoundException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php',
195
+ 'Nette\\FileNotFoundException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php',
196
+ 'Nette\\HtmlStringable' => __DIR__ . '/..' . '/nette/utils/src/HtmlStringable.php',
197
+ 'Nette\\IOException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php',
198
+ 'Nette\\InvalidArgumentException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php',
199
+ 'Nette\\InvalidStateException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php',
200
+ 'Nette\\Iterators\\CachingIterator' => __DIR__ . '/..' . '/nette/utils/src/Iterators/CachingIterator.php',
201
+ 'Nette\\Iterators\\Mapper' => __DIR__ . '/..' . '/nette/utils/src/Iterators/Mapper.php',
202
+ 'Nette\\Localization\\ITranslator' => __DIR__ . '/..' . '/nette/utils/src/compatibility.php',
203
+ 'Nette\\Localization\\Translator' => __DIR__ . '/..' . '/nette/utils/src/Translator.php',
204
+ 'Nette\\MemberAccessException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php',
205
+ 'Nette\\NotImplementedException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php',
206
+ 'Nette\\NotSupportedException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php',
207
+ 'Nette\\OutOfRangeException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php',
208
+ 'Nette\\SmartObject' => __DIR__ . '/..' . '/nette/utils/src/SmartObject.php',
209
+ 'Nette\\StaticClass' => __DIR__ . '/..' . '/nette/utils/src/StaticClass.php',
210
+ 'Nette\\UnexpectedValueException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php',
211
+ 'Nette\\Utils\\ArrayHash' => __DIR__ . '/..' . '/nette/utils/src/Utils/ArrayHash.php',
212
+ 'Nette\\Utils\\ArrayList' => __DIR__ . '/..' . '/nette/utils/src/Utils/ArrayList.php',
213
+ 'Nette\\Utils\\Arrays' => __DIR__ . '/..' . '/nette/utils/src/Utils/Arrays.php',
214
+ 'Nette\\Utils\\AssertionException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php',
215
+ 'Nette\\Utils\\Callback' => __DIR__ . '/..' . '/nette/utils/src/Utils/Callback.php',
216
+ 'Nette\\Utils\\DateTime' => __DIR__ . '/..' . '/nette/utils/src/Utils/DateTime.php',
217
+ 'Nette\\Utils\\FileInfo' => __DIR__ . '/..' . '/nette/utils/src/Utils/FileInfo.php',
218
+ 'Nette\\Utils\\FileSystem' => __DIR__ . '/..' . '/nette/utils/src/Utils/FileSystem.php',
219
+ 'Nette\\Utils\\Finder' => __DIR__ . '/..' . '/nette/utils/src/Utils/Finder.php',
220
+ 'Nette\\Utils\\Floats' => __DIR__ . '/..' . '/nette/utils/src/Utils/Floats.php',
221
+ 'Nette\\Utils\\Helpers' => __DIR__ . '/..' . '/nette/utils/src/Utils/Helpers.php',
222
+ 'Nette\\Utils\\Html' => __DIR__ . '/..' . '/nette/utils/src/Utils/Html.php',
223
+ 'Nette\\Utils\\IHtmlString' => __DIR__ . '/..' . '/nette/utils/src/compatibility.php',
224
+ 'Nette\\Utils\\Image' => __DIR__ . '/..' . '/nette/utils/src/Utils/Image.php',
225
+ 'Nette\\Utils\\ImageColor' => __DIR__ . '/..' . '/nette/utils/src/Utils/ImageColor.php',
226
+ 'Nette\\Utils\\ImageException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php',
227
+ 'Nette\\Utils\\ImageType' => __DIR__ . '/..' . '/nette/utils/src/Utils/ImageType.php',
228
+ 'Nette\\Utils\\Iterables' => __DIR__ . '/..' . '/nette/utils/src/Utils/Iterables.php',
229
+ 'Nette\\Utils\\Json' => __DIR__ . '/..' . '/nette/utils/src/Utils/Json.php',
230
+ 'Nette\\Utils\\JsonException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php',
231
+ 'Nette\\Utils\\ObjectHelpers' => __DIR__ . '/..' . '/nette/utils/src/Utils/ObjectHelpers.php',
232
+ 'Nette\\Utils\\Paginator' => __DIR__ . '/..' . '/nette/utils/src/Utils/Paginator.php',
233
+ 'Nette\\Utils\\Random' => __DIR__ . '/..' . '/nette/utils/src/Utils/Random.php',
234
+ 'Nette\\Utils\\Reflection' => __DIR__ . '/..' . '/nette/utils/src/Utils/Reflection.php',
235
+ 'Nette\\Utils\\ReflectionMethod' => __DIR__ . '/..' . '/nette/utils/src/Utils/ReflectionMethod.php',
236
+ 'Nette\\Utils\\RegexpException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php',
237
+ 'Nette\\Utils\\Strings' => __DIR__ . '/..' . '/nette/utils/src/Utils/Strings.php',
238
+ 'Nette\\Utils\\Type' => __DIR__ . '/..' . '/nette/utils/src/Utils/Type.php',
239
+ 'Nette\\Utils\\UnknownImageFileException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php',
240
+ 'Nette\\Utils\\Validators' => __DIR__ . '/..' . '/nette/utils/src/Utils/Validators.php',
192
241
  );
193
242
 
194
243
  public static function getInitializer(ClassLoader $loader)
@@ -87,6 +87,95 @@
87
87
  "source": "https://github.com/nette/latte/tree/v3.0.16"
88
88
  },
89
89
  "install-path": "../latte/latte"
90
+ },
91
+ {
92
+ "name": "nette/utils",
93
+ "version": "v4.0.4",
94
+ "version_normalized": "4.0.4.0",
95
+ "source": {
96
+ "type": "git",
97
+ "url": "https://github.com/nette/utils.git",
98
+ "reference": "d3ad0aa3b9f934602cb3e3902ebccf10be34d218"
99
+ },
100
+ "dist": {
101
+ "type": "zip",
102
+ "url": "https://api.github.com/repos/nette/utils/zipball/d3ad0aa3b9f934602cb3e3902ebccf10be34d218",
103
+ "reference": "d3ad0aa3b9f934602cb3e3902ebccf10be34d218",
104
+ "shasum": ""
105
+ },
106
+ "require": {
107
+ "php": ">=8.0 <8.4"
108
+ },
109
+ "conflict": {
110
+ "nette/finder": "<3",
111
+ "nette/schema": "<1.2.2"
112
+ },
113
+ "require-dev": {
114
+ "jetbrains/phpstorm-attributes": "dev-master",
115
+ "nette/tester": "^2.5",
116
+ "phpstan/phpstan": "^1.0",
117
+ "tracy/tracy": "^2.9"
118
+ },
119
+ "suggest": {
120
+ "ext-gd": "to use Image",
121
+ "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()",
122
+ "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()",
123
+ "ext-json": "to use Nette\\Utils\\Json",
124
+ "ext-mbstring": "to use Strings::lower() etc...",
125
+ "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()"
126
+ },
127
+ "time": "2024-01-17T16:50:36+00:00",
128
+ "type": "library",
129
+ "extra": {
130
+ "branch-alias": {
131
+ "dev-master": "4.0-dev"
132
+ }
133
+ },
134
+ "installation-source": "dist",
135
+ "autoload": {
136
+ "classmap": [
137
+ "src/"
138
+ ]
139
+ },
140
+ "notification-url": "https://packagist.org/downloads/",
141
+ "license": [
142
+ "BSD-3-Clause",
143
+ "GPL-2.0-only",
144
+ "GPL-3.0-only"
145
+ ],
146
+ "authors": [
147
+ {
148
+ "name": "David Grudl",
149
+ "homepage": "https://davidgrudl.com"
150
+ },
151
+ {
152
+ "name": "Nette Community",
153
+ "homepage": "https://nette.org/contributors"
154
+ }
155
+ ],
156
+ "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.",
157
+ "homepage": "https://nette.org",
158
+ "keywords": [
159
+ "array",
160
+ "core",
161
+ "datetime",
162
+ "images",
163
+ "json",
164
+ "nette",
165
+ "paginator",
166
+ "password",
167
+ "slugify",
168
+ "string",
169
+ "unicode",
170
+ "utf-8",
171
+ "utility",
172
+ "validation"
173
+ ],
174
+ "support": {
175
+ "issues": "https://github.com/nette/utils/issues",
176
+ "source": "https://github.com/nette/utils/tree/v4.0.4"
177
+ },
178
+ "install-path": "../nette/utils"
90
179
  }
91
180
  ],
92
181
  "dev": true,
@@ -3,7 +3,7 @@
3
3
  'name' => '__root__',
4
4
  'pretty_version' => 'dev-main',
5
5
  'version' => 'dev-main',
6
- 'reference' => '403b80671511fbd5ac645fa46031fe26ae02ff09',
6
+ 'reference' => 'd742b5ec390f5099eb53c9e1eea8c8263120b3b8',
7
7
  'type' => 'library',
8
8
  'install_path' => __DIR__ . '/../../',
9
9
  'aliases' => array(),
@@ -13,7 +13,7 @@
13
13
  '__root__' => array(
14
14
  'pretty_version' => 'dev-main',
15
15
  'version' => 'dev-main',
16
- 'reference' => '403b80671511fbd5ac645fa46031fe26ae02ff09',
16
+ 'reference' => 'd742b5ec390f5099eb53c9e1eea8c8263120b3b8',
17
17
  'type' => 'library',
18
18
  'install_path' => __DIR__ . '/../../',
19
19
  'aliases' => array(),
@@ -28,5 +28,14 @@
28
28
  'aliases' => array(),
29
29
  'dev_requirement' => false,
30
30
  ),
31
+ 'nette/utils' => array(
32
+ 'pretty_version' => 'v4.0.4',
33
+ 'version' => '4.0.4.0',
34
+ 'reference' => 'd3ad0aa3b9f934602cb3e3902ebccf10be34d218',
35
+ 'type' => 'library',
36
+ 'install_path' => __DIR__ . '/../nette/utils',
37
+ 'aliases' => array(),
38
+ 'dev_requirement' => false,
39
+ ),
31
40
  ),
32
41
  );
@@ -0,0 +1,13 @@
1
+ <?php
2
+
3
+ declare(strict_types=1);
4
+
5
+ namespace PHPSTORM_META;
6
+
7
+ override(\Nette\Utils\Arrays::get(0), elementType(0));
8
+ override(\Nette\Utils\Arrays::getRef(0), elementType(0));
9
+ override(\Nette\Utils\Arrays::grep(0), type(0));
10
+ override(\Nette\Utils\Arrays::toObject(0), type(1));
11
+
12
+ expectedArguments(\Nette\Utils\Image::resize(), 2, \Nette\Utils\Image::ShrinkOnly, \Nette\Utils\Image::Stretch, \Nette\Utils\Image::OrSmaller, \Nette\Utils\Image::OrBigger, \Nette\Utils\Image::Cover);
13
+ expectedArguments(\Nette\Utils\Image::calculateSize(), 4, \Nette\Utils\Image::ShrinkOnly, \Nette\Utils\Image::Stretch, \Nette\Utils\Image::OrSmaller, \Nette\Utils\Image::OrBigger, \Nette\Utils\Image::Cover);
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "nette/utils",
3
+ "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.",
4
+ "keywords": ["nette", "images", "json", "password", "validation", "utility", "string", "array", "core", "slugify", "utf-8", "unicode", "paginator", "datetime"],
5
+ "homepage": "https://nette.org",
6
+ "license": ["BSD-3-Clause", "GPL-2.0-only", "GPL-3.0-only"],
7
+ "authors": [
8
+ {
9
+ "name": "David Grudl",
10
+ "homepage": "https://davidgrudl.com"
11
+ },
12
+ {
13
+ "name": "Nette Community",
14
+ "homepage": "https://nette.org/contributors"
15
+ }
16
+ ],
17
+ "require": {
18
+ "php": ">=8.0 <8.4"
19
+ },
20
+ "require-dev": {
21
+ "nette/tester": "^2.5",
22
+ "tracy/tracy": "^2.9",
23
+ "phpstan/phpstan": "^1.0",
24
+ "jetbrains/phpstorm-attributes": "dev-master"
25
+ },
26
+ "conflict": {
27
+ "nette/finder": "<3",
28
+ "nette/schema": "<1.2.2"
29
+ },
30
+ "suggest": {
31
+ "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()",
32
+ "ext-json": "to use Nette\\Utils\\Json",
33
+ "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()",
34
+ "ext-mbstring": "to use Strings::lower() etc...",
35
+ "ext-gd": "to use Image",
36
+ "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()"
37
+ },
38
+ "autoload": {
39
+ "classmap": ["src/"]
40
+ },
41
+ "minimum-stability": "dev",
42
+ "scripts": {
43
+ "phpstan": "phpstan analyse",
44
+ "tester": "tester tests -s"
45
+ },
46
+ "extra": {
47
+ "branch-alias": {
48
+ "dev-master": "4.0-dev"
49
+ }
50
+ }
51
+ }
@@ -0,0 +1,60 @@
1
+ Licenses
2
+ ========
3
+
4
+ Good news! You may use Nette Framework under the terms of either
5
+ the New BSD License or the GNU General Public License (GPL) version 2 or 3.
6
+
7
+ The BSD License is recommended for most projects. It is easy to understand and it
8
+ places almost no restrictions on what you can do with the framework. If the GPL
9
+ fits better to your project, you can use the framework under this license.
10
+
11
+ You don't have to notify anyone which license you are using. You can freely
12
+ use Nette Framework in commercial projects as long as the copyright header
13
+ remains intact.
14
+
15
+ Please be advised that the name "Nette Framework" is a protected trademark and its
16
+ usage has some limitations. So please do not use word "Nette" in the name of your
17
+ project or top-level domain, and choose a name that stands on its own merits.
18
+ If your stuff is good, it will not take long to establish a reputation for yourselves.
19
+
20
+
21
+ New BSD License
22
+ ---------------
23
+
24
+ Copyright (c) 2004, 2014 David Grudl (https://davidgrudl.com)
25
+ All rights reserved.
26
+
27
+ Redistribution and use in source and binary forms, with or without modification,
28
+ are permitted provided that the following conditions are met:
29
+
30
+ * Redistributions of source code must retain the above copyright notice,
31
+ this list of conditions and the following disclaimer.
32
+
33
+ * Redistributions in binary form must reproduce the above copyright notice,
34
+ this list of conditions and the following disclaimer in the documentation
35
+ and/or other materials provided with the distribution.
36
+
37
+ * Neither the name of "Nette Framework" nor the names of its contributors
38
+ may be used to endorse or promote products derived from this software
39
+ without specific prior written permission.
40
+
41
+ This software is provided by the copyright holders and contributors "as is" and
42
+ any express or implied warranties, including, but not limited to, the implied
43
+ warranties of merchantability and fitness for a particular purpose are
44
+ disclaimed. In no event shall the copyright owner or contributors be liable for
45
+ any direct, indirect, incidental, special, exemplary, or consequential damages
46
+ (including, but not limited to, procurement of substitute goods or services;
47
+ loss of use, data, or profits; or business interruption) however caused and on
48
+ any theory of liability, whether in contract, strict liability, or tort
49
+ (including negligence or otherwise) arising in any way out of the use of this
50
+ software, even if advised of the possibility of such damage.
51
+
52
+
53
+ GNU General Public License
54
+ --------------------------
55
+
56
+ GPL licenses are very very long, so instead of including them here we offer
57
+ you URLs with full text:
58
+
59
+ - [GPL version 2](http://www.gnu.org/licenses/gpl-2.0.html)
60
+ - [GPL version 3](http://www.gnu.org/licenses/gpl-3.0.html)
@@ -0,0 +1,56 @@
1
+ Nette Utility Classes
2
+ =====================
3
+
4
+ [![Downloads this Month](https://img.shields.io/packagist/dm/nette/utils.svg)](https://packagist.org/packages/nette/utils)
5
+ [![Tests](https://github.com/nette/utils/workflows/Tests/badge.svg?branch=master)](https://github.com/nette/utils/actions)
6
+ [![Coverage Status](https://coveralls.io/repos/github/nette/utils/badge.svg?branch=master)](https://coveralls.io/github/nette/utils?branch=master)
7
+ [![Latest Stable Version](https://poser.pugx.org/nette/utils/v/stable)](https://github.com/nette/utils/releases)
8
+ [![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/nette/utils/blob/master/license.md)
9
+
10
+
11
+ Introduction
12
+ ------------
13
+
14
+ In package nette/utils you will find a set of [useful classes](https://doc.nette.org/utils) for everyday use:
15
+
16
+ - [Arrays](https://doc.nette.org/utils/arrays) - manipulate arrays
17
+ - [Callback](https://doc.nette.org/utils/callback) - PHP callbacks
18
+ - [Date and Time](https://doc.nette.org/utils/datetime) - modify times and dates
19
+ - [Filesystem](https://doc.nette.org/utils/filesystem) - copying, renaming, …
20
+ - [Finder](https://doc.nette.org/utils/finder) - finds files and directories
21
+ - [Helper Functions](https://doc.nette.org/utils/helpers)
22
+ - [HTML elements](https://doc.nette.org/utils/html-elements) - generate HTML
23
+ - [Images](https://doc.nette.org/utils/images) - crop, resize, rotate images
24
+ - [JSON](https://doc.nette.org/utils/json) - encoding and decoding
25
+ - [Generating Random Strings](https://doc.nette.org/utils/random)
26
+ - [Paginator](https://doc.nette.org/utils/paginator) - pagination math
27
+ - [PHP Reflection](https://doc.nette.org/utils/reflection)
28
+ - [Strings](https://doc.nette.org/utils/strings) - useful text functions
29
+ - [SmartObject](https://doc.nette.org/utils/smartobject) - PHP object enhancements
30
+ - [Validation](https://doc.nette.org/utils/validators) - validate inputs
31
+ - [Type](https://doc.nette.org/utils/type) - PHP data type
32
+
33
+
34
+ Installation
35
+ ------------
36
+
37
+ The recommended way to install is via Composer:
38
+
39
+ ```
40
+ composer require nette/utils
41
+ ```
42
+
43
+ - Nette Utils 4.0 is compatible with PHP 8.0 to 8.3
44
+ - Nette Utils 3.2 is compatible with PHP 7.2 to 8.3
45
+ - Nette Utils 3.1 is compatible with PHP 7.1 to 8.0
46
+ - Nette Utils 3.0 is compatible with PHP 7.1 to 8.0
47
+ - Nette Utils 2.5 is compatible with PHP 5.6 to 8.0
48
+
49
+ [Support Me](https://github.com/sponsors/dg)
50
+ --------------------------------------------
51
+
52
+ Do you like Nette Utils? Are you looking forward to the new features?
53
+
54
+ [![Buy me a coffee](https://files.nette.org/icons/donation-3.svg)](https://github.com/sponsors/dg)
55
+
56
+ Thank you!
@@ -0,0 +1,22 @@
1
+ <?php
2
+
3
+ /**
4
+ * This file is part of the Nette Framework (https://nette.org)
5
+ * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6
+ */
7
+
8
+ declare(strict_types=1);
9
+
10
+ namespace Nette;
11
+
12
+
13
+ interface HtmlStringable
14
+ {
15
+ /**
16
+ * Returns string in HTML format
17
+ */
18
+ function __toString(): string;
19
+ }
20
+
21
+
22
+ interface_exists(Utils\IHtmlString::class);
@@ -0,0 +1,164 @@
1
+ <?php
2
+
3
+ /**
4
+ * This file is part of the Nette Framework (https://nette.org)
5
+ * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6
+ */
7
+
8
+ declare(strict_types=1);
9
+
10
+ namespace Nette\Iterators;
11
+
12
+ use Nette;
13
+
14
+
15
+ /**
16
+ * Smarter caching iterator.
17
+ *
18
+ * @property-read bool $first
19
+ * @property-read bool $last
20
+ * @property-read bool $empty
21
+ * @property-read bool $odd
22
+ * @property-read bool $even
23
+ * @property-read int $counter
24
+ * @property-read mixed $nextKey
25
+ * @property-read mixed $nextValue
26
+ */
27
+ class CachingIterator extends \CachingIterator implements \Countable
28
+ {
29
+ use Nette\SmartObject;
30
+
31
+ private int $counter = 0;
32
+
33
+
34
+ public function __construct($iterator)
35
+ {
36
+ if (is_array($iterator) || $iterator instanceof \stdClass) {
37
+ $iterator = new \ArrayIterator($iterator);
38
+
39
+ } elseif ($iterator instanceof \IteratorAggregate) {
40
+ do {
41
+ $iterator = $iterator->getIterator();
42
+ } while ($iterator instanceof \IteratorAggregate);
43
+
44
+ assert($iterator instanceof \Iterator);
45
+
46
+ } elseif ($iterator instanceof \Iterator) {
47
+ } elseif ($iterator instanceof \Traversable) {
48
+ $iterator = new \IteratorIterator($iterator);
49
+ } else {
50
+ throw new Nette\InvalidArgumentException(sprintf('Invalid argument passed to %s; array or Traversable expected, %s given.', self::class, get_debug_type($iterator)));
51
+ }
52
+
53
+ parent::__construct($iterator, 0);
54
+ }
55
+
56
+
57
+ /**
58
+ * Is the current element the first one?
59
+ */
60
+ public function isFirst(?int $gridWidth = null): bool
61
+ {
62
+ return $this->counter === 1 || ($gridWidth && $this->counter !== 0 && (($this->counter - 1) % $gridWidth) === 0);
63
+ }
64
+
65
+
66
+ /**
67
+ * Is the current element the last one?
68
+ */
69
+ public function isLast(?int $gridWidth = null): bool
70
+ {
71
+ return !$this->hasNext() || ($gridWidth && ($this->counter % $gridWidth) === 0);
72
+ }
73
+
74
+
75
+ /**
76
+ * Is the iterator empty?
77
+ */
78
+ public function isEmpty(): bool
79
+ {
80
+ return $this->counter === 0;
81
+ }
82
+
83
+
84
+ /**
85
+ * Is the counter odd?
86
+ */
87
+ public function isOdd(): bool
88
+ {
89
+ return $this->counter % 2 === 1;
90
+ }
91
+
92
+
93
+ /**
94
+ * Is the counter even?
95
+ */
96
+ public function isEven(): bool
97
+ {
98
+ return $this->counter % 2 === 0;
99
+ }
100
+
101
+
102
+ /**
103
+ * Returns the counter.
104
+ */
105
+ public function getCounter(): int
106
+ {
107
+ return $this->counter;
108
+ }
109
+
110
+
111
+ /**
112
+ * Returns the count of elements.
113
+ */
114
+ public function count(): int
115
+ {
116
+ $inner = $this->getInnerIterator();
117
+ if ($inner instanceof \Countable) {
118
+ return $inner->count();
119
+
120
+ } else {
121
+ throw new Nette\NotSupportedException('Iterator is not countable.');
122
+ }
123
+ }
124
+
125
+
126
+ /**
127
+ * Forwards to the next element.
128
+ */
129
+ public function next(): void
130
+ {
131
+ parent::next();
132
+ if (parent::valid()) {
133
+ $this->counter++;
134
+ }
135
+ }
136
+
137
+
138
+ /**
139
+ * Rewinds the Iterator.
140
+ */
141
+ public function rewind(): void
142
+ {
143
+ parent::rewind();
144
+ $this->counter = parent::valid() ? 1 : 0;
145
+ }
146
+
147
+
148
+ /**
149
+ * Returns the next key.
150
+ */
151
+ public function getNextKey(): mixed
152
+ {
153
+ return $this->getInnerIterator()->key();
154
+ }
155
+
156
+
157
+ /**
158
+ * Returns the next element.
159
+ */
160
+ public function getNextValue(): mixed
161
+ {
162
+ return $this->getInnerIterator()->current();
163
+ }
164
+ }
@@ -0,0 +1,34 @@
1
+ <?php
2
+
3
+ /**
4
+ * This file is part of the Nette Framework (https://nette.org)
5
+ * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6
+ */
7
+
8
+ declare(strict_types=1);
9
+
10
+ namespace Nette\Iterators;
11
+
12
+
13
+
14
+ /**
15
+ * Applies the callback to the elements of the inner iterator.
16
+ */
17
+ class Mapper extends \IteratorIterator
18
+ {
19
+ /** @var callable */
20
+ private $callback;
21
+
22
+
23
+ public function __construct(\Traversable $iterator, callable $callback)
24
+ {
25
+ parent::__construct($iterator);
26
+ $this->callback = $callback;
27
+ }
28
+
29
+
30
+ public function current(): mixed
31
+ {
32
+ return ($this->callback)(parent::current(), parent::key());
33
+ }
34
+ }