mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-29 21:48:45 +02:00
N°6934 - Symfony 6.4 - upgrade Symfony bundles to 6.4 (#580)
* Update Symfony lib to version ~6.4.0 * Update code missing return type * Add an iTop general configuration entry to store application secret (Symfony mandatory parameter) * Use dependency injection in ExceptionListener & UserProvider classes
This commit is contained in:
@@ -10,6 +10,10 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
if ('cli' !== \PHP_SAPI) {
|
||||
throw new Exception('This script must be run from the command line.');
|
||||
}
|
||||
|
||||
// Run from the root of the php-src repository, this script generates
|
||||
// a table with all the methods that have a tentative return type.
|
||||
//
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
if ('cli' !== \PHP_SAPI) {
|
||||
throw new Exception('This script must be run from the command line.');
|
||||
}
|
||||
|
||||
if (\in_array('-h', $argv) || \in_array('--help', $argv)) {
|
||||
echo implode(PHP_EOL, [
|
||||
' Patches type declarations based on "@return" PHPDoc and triggers deprecations for',
|
||||
@@ -20,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',
|
||||
@@ -71,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;
|
||||
}
|
||||
|
||||
@@ -89,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user