Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6364d3c

Browse files
committed
[ErrorHandler] Add helper script to patch type declarations
1 parent2085ff8 commit6364d3c

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
/*
5+
* This file is part of the Symfony package.
6+
*
7+
* (c) Fabien Potencier <fabien@symfony.com>
8+
*
9+
* For the full copyright and license information, please view the LICENSE
10+
* file that was distributed with this source code.
11+
*/
12+
13+
require__DIR__.DIRECTORY_SEPARATOR.'patch-type-declarations.php';
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
if (false ===getenv('SYMFONY_PATCH_TYPE_DECLARATIONS')) {
13+
putenv('SYMFONY_PATCH_TYPE_DECLARATIONS=force=2');
14+
echo'Patching type declarations in all methods';
15+
}
16+
17+
if (is_file($autoload =__DIR__.'/../../../autoload.php')) {
18+
// noop
19+
}elseif (is_file($autoload =__DIR__.'/../../../../../autoload.php')) {
20+
// noop
21+
}elseif (is_file($autoload =__DIR__.'/../../../../../vendor/autoload.php')) {
22+
// noop
23+
}else {
24+
echo'Cannot find the Composer autoloader, did you forget to run "composer install"?';
25+
exit(1);
26+
}
27+
28+
if (is_file($phpunitAutoload =pathinfo($autoload, \PATHINFO_DIRNAME).'/bin/.phpunit/phpunit/vendor/autoload.php')) {
29+
require$phpunitAutoload;
30+
}
31+
32+
$loader =require$autoload;
33+
34+
Symfony\Component\ErrorHandler\DebugClassLoader::enable();
35+
36+
$exclude =getenv('SYMFONY_PATCH_TYPE_EXCLUDE') ?:'/'.preg_quote(DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR).'/';
37+
foreach ($loader->getClassMap()as$class =>$file) {
38+
if (preg_match($exclude,realpath($file))) {
39+
continue;
40+
}
41+
42+
class_exists($class);
43+
}
44+
45+
Symfony\Component\ErrorHandler\DebugClassLoader::checkClasses();

‎src/Symfony/Component/ErrorHandler/composer.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@
3131
"/Tests/"
3232
]
3333
},
34+
"bin": [
35+
"Resources/bin/patch-type-declarations"
36+
],
3437
"minimum-stability":"dev"
3538
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp