Skip to content

Commit f3dc88b

Browse files
Merge branch '12.0'
2 parents 56ac8de + b1661ff commit f3dc88b

21 files changed

+117
-93
lines changed

.phive/phars.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
<phar name="phpab" version="^1.29" installed="1.29.3" location="./tools/phpab" copy="true"/>
44
<phar name="php-cs-fixer" version="^3.69" installed="3.75.0" location="./tools/php-cs-fixer" copy="true"/>
55
<phar name="humbug/php-scoper" version="^0.18" installed="0.18.17" location="./tools/php-scoper" copy="true"/>
6-
<phar name="composer" version="^2.8" installed="2.8.6" location="./tools/composer" copy="true"/>
6+
<phar name="composer" version="^2.8" installed="2.8.7" location="./tools/composer" copy="true"/>
77
</phive>

tools/.phpstan/composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/.phpstan/vendor/autoload.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
echo $err;
1515
}
1616
}
17-
trigger_error(
18-
$err,
19-
E_USER_ERROR
20-
);
17+
throw new RuntimeException($err);
2118
}
2219

2320
require_once __DIR__ . '/composer/autoload_real.php';

tools/.phpstan/vendor/composer/InstalledVersions.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
*/
2727
class InstalledVersions
2828
{
29+
/**
30+
* @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
31+
* @internal
32+
*/
33+
private static $selfDir = null;
34+
2935
/**
3036
* @var mixed[]|null
3137
* @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
@@ -322,6 +328,18 @@ public static function reload($data)
322328
self::$installedIsLocalDir = false;
323329
}
324330

331+
/**
332+
* @return string
333+
*/
334+
private static function getSelfDir()
335+
{
336+
if (self::$selfDir === null) {
337+
self::$selfDir = strtr(__DIR__, '\\', '/');
338+
}
339+
340+
return self::$selfDir;
341+
}
342+
325343
/**
326344
* @return array[]
327345
* @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[]}>}>
@@ -336,7 +354,7 @@ private static function getInstalled()
336354
$copiedLocalDir = false;
337355

338356
if (self::$canGetVendors) {
339-
$selfDir = strtr(__DIR__, '\\', '/');
357+
$selfDir = self::getSelfDir();
340358
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
341359
$vendorDir = strtr($vendorDir, '\\', '/');
342360
if (isset(self::$installedByVendor[$vendorDir])) {

tools/.phpstan/vendor/composer/autoload_classmap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
'Nette\\NotImplementedException' => $vendorDir . '/nette/utils/src/exceptions.php',
2424
'Nette\\NotSupportedException' => $vendorDir . '/nette/utils/src/exceptions.php',
2525
'Nette\\OutOfRangeException' => $vendorDir . '/nette/utils/src/exceptions.php',
26+
'Nette\\ShouldNotHappenException' => $vendorDir . '/nette/utils/src/exceptions.php',
2627
'Nette\\SmartObject' => $vendorDir . '/nette/utils/src/SmartObject.php',
2728
'Nette\\StaticClass' => $vendorDir . '/nette/utils/src/StaticClass.php',
2829
'Nette\\UnexpectedValueException' => $vendorDir . '/nette/utils/src/exceptions.php',

tools/.phpstan/vendor/composer/autoload_static.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class ComposerStaticInitf9e7218f71d5874b5632927df4f72bd7
6363
'Nette\\NotImplementedException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php',
6464
'Nette\\NotSupportedException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php',
6565
'Nette\\OutOfRangeException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php',
66+
'Nette\\ShouldNotHappenException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php',
6667
'Nette\\SmartObject' => __DIR__ . '/..' . '/nette/utils/src/SmartObject.php',
6768
'Nette\\StaticClass' => __DIR__ . '/..' . '/nette/utils/src/StaticClass.php',
6869
'Nette\\UnexpectedValueException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php',

tools/.phpstan/vendor/composer/installed.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,17 @@
7777
},
7878
{
7979
"name": "nette/utils",
80-
"version": "v4.0.5",
81-
"version_normalized": "4.0.5.0",
80+
"version": "v4.0.6",
81+
"version_normalized": "4.0.6.0",
8282
"source": {
8383
"type": "git",
8484
"url": "https://github.com/nette/utils.git",
85-
"reference": "736c567e257dbe0fcf6ce81b4d6dbe05c6899f96"
85+
"reference": "ce708655043c7050eb050df361c5e313cf708309"
8686
},
8787
"dist": {
8888
"type": "zip",
89-
"url": "https://api.github.com/repos/nette/utils/zipball/736c567e257dbe0fcf6ce81b4d6dbe05c6899f96",
90-
"reference": "736c567e257dbe0fcf6ce81b4d6dbe05c6899f96",
89+
"url": "https://api.github.com/repos/nette/utils/zipball/ce708655043c7050eb050df361c5e313cf708309",
90+
"reference": "ce708655043c7050eb050df361c5e313cf708309",
9191
"shasum": ""
9292
},
9393
"require": {
@@ -111,7 +111,7 @@
111111
"ext-mbstring": "to use Strings::lower() etc...",
112112
"ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()"
113113
},
114-
"time": "2024-08-07T15:39:19+00:00",
114+
"time": "2025-03-30T21:06:30+00:00",
115115
"type": "library",
116116
"extra": {
117117
"branch-alias": {
@@ -160,7 +160,7 @@
160160
],
161161
"support": {
162162
"issues": "https://github.com/nette/utils/issues",
163-
"source": "https://github.com/nette/utils/tree/v4.0.5"
163+
"source": "https://github.com/nette/utils/tree/v4.0.6"
164164
},
165165
"install-path": "../nette/utils"
166166
},

tools/.phpstan/vendor/composer/installed.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
'name' => '__root__',
44
'pretty_version' => 'dev-main',
55
'version' => 'dev-main',
6-
'reference' => 'dd3bb4b763ac0e0c924216a1f04407ba059eb2d1',
6+
'reference' => '56ac8de3a635180e1f0c80f70d4f6680bfe81cb3',
77
'type' => 'library',
88
'install_path' => __DIR__ . '/../../',
99
'aliases' => array(),
@@ -13,7 +13,7 @@
1313
'__root__' => array(
1414
'pretty_version' => 'dev-main',
1515
'version' => 'dev-main',
16-
'reference' => 'dd3bb4b763ac0e0c924216a1f04407ba059eb2d1',
16+
'reference' => '56ac8de3a635180e1f0c80f70d4f6680bfe81cb3',
1717
'type' => 'library',
1818
'install_path' => __DIR__ . '/../../',
1919
'aliases' => array(),
@@ -29,9 +29,9 @@
2929
'dev_requirement' => true,
3030
),
3131
'nette/utils' => array(
32-
'pretty_version' => 'v4.0.5',
33-
'version' => '4.0.5.0',
34-
'reference' => '736c567e257dbe0fcf6ce81b4d6dbe05c6899f96',
32+
'pretty_version' => 'v4.0.6',
33+
'version' => '4.0.6.0',
34+
'reference' => 'ce708655043c7050eb050df361c5e313cf708309',
3535
'type' => 'library',
3636
'install_path' => __DIR__ . '/../nette/utils',
3737
'aliases' => array(),

tools/.phpstan/vendor/nette/utils/src/Utils/Arrays.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ public static function flatten(array $array, bool $preserveKeys = false): array
277277
*/
278278
public static function isList(mixed $value): bool
279279
{
280-
return is_array($value) && (PHP_VERSION_ID < 80100
280+
return is_array($value) && (
281+
PHP_VERSION_ID < 80100
281282
? !$value || array_keys($value) === range(0, count($value) - 1)
282283
: array_is_list($value)
283284
);

tools/.phpstan/vendor/nette/utils/src/Utils/FileSystem.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public static function makeWritable(string $path, int $dirMode = 0777, int $file
271271
*/
272272
public static function isAbsolute(string $path): bool
273273
{
274-
return (bool) preg_match('#([a-z]:)?[/\\\\]|[a-z][a-z0-9+.-]*://#Ai', $path);
274+
return (bool) preg_match('#([a-z]:)?[/\\\]|[a-z][a-z0-9+.-]*://#Ai', $path);
275275
}
276276

277277

@@ -280,7 +280,7 @@ public static function isAbsolute(string $path): bool
280280
*/
281281
public static function normalizePath(string $path): string
282282
{
283-
$parts = $path === '' ? [] : preg_split('~[/\\\\]+~', $path);
283+
$parts = $path === '' ? [] : preg_split('~[/\\\]+~', $path);
284284
$res = [];
285285
foreach ($parts as $part) {
286286
if ($part === '..' && $res && end($res) !== '..' && end($res) !== '') {
@@ -305,6 +305,19 @@ public static function joinPaths(string ...$paths): string
305305
}
306306

307307

308+
/**
309+
* Resolves a path against a base path. If the path is absolute, returns it directly, if it's relative, joins it with the base path.
310+
*/
311+
public static function resolvePath(string $basePath, string $path): string
312+
{
313+
return match (true) {
314+
self::isAbsolute($path) => self::platformSlashes($path),
315+
$path === '' => self::platformSlashes($basePath),
316+
default => self::joinPaths($basePath, $path),
317+
};
318+
}
319+
320+
308321
/**
309322
* Converts backslashes to slashes.
310323
*/

0 commit comments

Comments
 (0)