package and depencies
This commit is contained in:
@@ -24,7 +24,7 @@ if (\in_array('-h', $argv) || \in_array('--help', $argv)) {
|
||||
'',
|
||||
' Available configuration via environment variables:',
|
||||
' SYMFONY_PATCH_TYPE_DECLARATIONS',
|
||||
' An url-encoded string to change the behavior of the script. Available parameters:',
|
||||
' A url-encoded string to change the behavior of the script. Available parameters:',
|
||||
' - "force": any value enables deprecation notices - can be any of:',
|
||||
' - "phpdoc" to patch only docblock annotations',
|
||||
' - "2" to add all possible return types',
|
||||
@@ -75,7 +75,7 @@ set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$dep
|
||||
|
||||
$exclude = getenv('SYMFONY_PATCH_TYPE_EXCLUDE') ?: null;
|
||||
foreach ($loader->getClassMap() as $class => $file) {
|
||||
if (false !== strpos($file = realpath($file), \DIRECTORY_SEPARATOR.'vendor'.\DIRECTORY_SEPARATOR)) {
|
||||
if (str_contains($file = realpath($file), \DIRECTORY_SEPARATOR.'vendor'.\DIRECTORY_SEPARATOR)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -93,6 +93,6 @@ foreach ($deprecations as $class => $classDeprecations) {
|
||||
echo implode(PHP_EOL, $classDeprecations).PHP_EOL.PHP_EOL;
|
||||
}
|
||||
|
||||
if ($deprecations && false !== strpos(getenv('SYMFONY_PATCH_TYPE_DECLARATIONS') ?? '', 'force')) {
|
||||
if ($deprecations && str_contains(getenv('SYMFONY_PATCH_TYPE_DECLARATIONS') ?? '', 'force')) {
|
||||
echo 'These deprecations might be fixed by the patch script, run this again to check for type deprecations.'.PHP_EOL;
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@
|
||||
<meta charset="<?= $this->charset; ?>" />
|
||||
<meta name="robots" content="noindex,nofollow,noarchive" />
|
||||
<title>An Error Occurred: <?= $statusText; ?></title>
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>❌</text></svg>">
|
||||
<style><?= $this->include('assets/css/error.css'); ?></style>
|
||||
</head>
|
||||
<body>
|
||||
|
@@ -35,7 +35,7 @@
|
||||
$last = $exceptionAsArrayCount - 1;
|
||||
foreach ($exceptionAsArray as $i => $e) {
|
||||
foreach ($e['trace'] as $trace) {
|
||||
if ($trace['file'] && false === mb_strpos($trace['file'], '/vendor/') && false === mb_strpos($trace['file'], '/var/cache/') && $i < $last) {
|
||||
if ($trace['file'] && !str_contains($trace['file'], '/vendor/') && !str_contains($trace['file'], '/var/cache/') && $i < $last) {
|
||||
$exceptionWithUserCode[] = $i;
|
||||
}
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@
|
||||
<?php
|
||||
$isFirstUserCode = true;
|
||||
foreach ($exception['trace'] as $i => $trace) {
|
||||
$isVendorTrace = $trace['file'] && (false !== mb_strpos($trace['file'], '/vendor/') || false !== mb_strpos($trace['file'], '/var/cache/'));
|
||||
$isVendorTrace = $trace['file'] && (str_contains($trace['file'], '/vendor/') || str_contains($trace['file'], '/var/cache/'));
|
||||
$displayCodeSnippet = $isFirstUserCode && !$isVendorTrace;
|
||||
if ($displayCodeSnippet) {
|
||||
$isFirstUserCode = false;
|
||||
|
Reference in New Issue
Block a user