8000 Merge branch '5.1' into 5.2 · symfony/symfony@f37f56c · GitHub
[go: up one dir, main page]

Skip to content

Commit f37f56c

Browse files
Merge branch '5.1' into 5.2
* 5.1: minor cs fix [Config][TwigBundle] Fixed syntax error in config [DI] Fix Xdebug 3.0 detection Use php8 stable [Notifier] Streamline changelogs of notifier bridges [Cache] fix checking for redis_sentinel support [Messenger] Fixed wording in php doc [Intl] Update the ICU data to 68.1 [FrameworkBundle] acces public-deprecated services via the private container to remove false-positive deprecations Remove unused @throws tags and handling of never thrown exceptions [PhpUnitBridge] Fix disabling DeprecationErrorHandler from phpunit configuration file
2 parents 9a7034e + a2f0734 commit f37f56c

File tree

556 files changed

+9280
-6813
lines changed
  • Tests/Definition/Dumper
  • Console/DependencyInjection
  • DependencyInjection/Exception
  • Form/Tests/Extension/Core/Type
  • HttpFoundation
  • HttpKernel/DataCollector
  • Intl
  • Some content is hidden

    Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

    556 files changed

    +9280
    -6813
    lines changed

    .travis.yml

    Lines changed: 1 addition & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -26,12 +26,9 @@ matrix:
    2626
    env: deps=high
    2727
    - php: 7.4
    2828
    env: deps=low
    29-
    - php: 8.0snapshot
    29+
    - php: 8.0
    3030
    services: [memcached]
    3131
    fast_finish: true
    32-
    allow_failures:
    33-
    - php: 8.0snapshot
    34-
    services: [memcached]
    3532

    3633
    cache:
    3734
    directories:

    src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php

    Lines changed: 4 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -153,6 +153,10 @@
    153153
    }
    154154
    }
    155155

    156+
    if ('disabled' === $getEnvVar('SYMFONY_DEPRECATIONS_HELPER')) {
    157+
    putenv('SYMFONY_DEPRECATIONS_HELPER=disabled');
    158+
    }
    159+
    156160
    $COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar')
    157161
    || ($COMPOSER = rtrim('\\' === \DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar 2> /dev/null`))
    158162
    || ($COMPOSER = rtrim('\\' === \DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer`) : `which composer 2> /dev/null`))

    src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TestServiceContainerWeakRefPass.php

    Lines changed: 8 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -22,6 +22,13 @@
    2222
    */
    2323
    class TestServiceContainerWeakRefPass implements CompilerPassInterface
    2424
    {
    25+
    private $privateTagName;
    26+
    27+
    public function __construct(string $privateTagName = 'container.private')
    28+
    {
    29+
    $this->privateTagName = $privateTagName;
    30+
    }
    31+
    2532
    public function process(ContainerBuilder $container)
    2633
    {
    2734
    if (!$container->hasDefinition('test.private_services_locator')) {
    @@ -33,7 +40,7 @@ public function process(ContainerBuilder $container)
    3340
    $hasErrors = method_exists(Definition::class, 'hasErrors') ? 'hasErrors' : 'getErrors';
    3441

    3542
    foreach ($definitions as $id => $definition) {
    36-
    if ($id && '.' !== $id[0] && (!$definition->isPublic() || $definition->isPrivate()) && !$definition->$hasErrors() && !$definition->isAbstract()) {
    43+
    if ($id && '.' !== $id[0] && (!$definition->isPublic() || $definition->isPrivate() || $definition->hasTag($this->privateTagName)) && !$definition->$hasErrors() && !$definition->isAbstract()) {
    3744
    $privateServices[$id] = new Reference($id, ContainerBuilder::IGNORE_ON_UNINITIALIZED_REFERENCE);
    3845
    }
    3946
    }

    src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TestServiceContainerRefPassesTest.php

    Lines changed: 7 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -36,6 +36,12 @@ public function testProcess()
    3636
    ->setPublic(true)
    3737
    ->addArgument(new Reference('Test\private_used_shared_service'))
    3838
    ->addArgument(new Reference('Test\private_used_non_shared_service'))
    39+
    ->addArgument(new Reference('Test\soon_private_service'))
    40+
    ;
    41+
    42+
    $container->register('Test\soon_private_service')
    43+
    ->setPublic(true)
    44+
    ->addTag('container.private', ['package' => 'foo/bar', 'version' => '1.42'])
    3945
    ;
    4046

    4147
    $container->register('Test\private_used_shared_service');
    @@ -48,6 +54,7 @@ public function testProcess()
    4854
    $expected = [
    4955
    'Test\private_used_shared_service' => new ServiceClosureArgument(new Reference('Test\private_used_shared_service')),
    5056
    'Test\private_used_non_shared_service' => new ServiceClosureArgument(new Reference('Test\private_used_non_shared_service')),
    57+
    'Test\soon_private_service' => new ServiceClosureArgument(new Reference('.container.private.Test\soon_private_service')),
    5158
    'Psr\Container\ContainerInterface' => new ServiceClosureArgument(new Reference('service_container')),
    5259
    'Symfony\Component\DependencyInjection\ContainerInterface' => new ServiceClosureArgument(new Reference('service_container')),
    5360
    ];

    src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -82,7 +82,7 @@ private function addGlobalsSection(ArrayNodeDefinition $rootNode)
    8282
    ->arrayNode('globals')
    8383
    ->normalizeKeys(false)
    8484
    ->useAttributeAsKey('key')
    85-
    ->example(['foo' => '"@bar"', 'pi' => 3.14])
    85+
    ->example(['foo' => '@bar', 'pi' => 3.14])
    8686
    ->prototype('array')
    8787
    ->normalizeKeys(false)
    8888
    ->beforeNormalization()

    src/Symfony/Component/Cache/Traits/RedisTrait.php

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -159,12 +159,12 @@ public static function createConnection($dsn, array $options = [])
    159159
    throw new InvalidArgumentException(sprintf('Invalid Redis DSN: "%s".', $dsn));
    160160
    }
    161161

    162+
    $params += $query + $options + self::$defaultConnectionOptions;
    163+
    162164
    if (isset($params['redis_sentinel']) && !class_exists(\Predis\Client::class)) {
    163165
    throw new CacheException(sprintf('Redis Sentinel support requires the "predis/predis" package: "%s".', $dsn));
    164166
    }
    165167

    166-
    $params += $query + $options + self::$defaultConnectionOptions;
    167-
    168168
    if (null === $params['class'] && !isset($params['redis_sentinel']) && \extension_loaded('redis')) {
    169169
    $class = $params['redis_cluster'] ? \RedisCluster::class : (1 < \count($hosts) ? \RedisArray::class : \Redis::class);
    170170
    } else {

    src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -130,7 +130,7 @@ private function writeNode(NodeInterface $node, NodeInterface $parentNode = null
    130130

    131131
    // example
    132132
    if ($example && !\is_array($example)) {
    133-
    $comments[] = 'Example: '.$example;
    133+
    $comments[] = 'Example: '.Inline::dump($example);
    134134
    }
    135135

    136136
    $default = '' != (string) $default ? ' '.$default : '';
    @@ -166,7 +166,7 @@ private function writeNode(NodeInterface $node, NodeInterface $parentNode = null
    166166

    167167
    $this->writeLine('# '.$message.':', $depth * 4 + 4);
    168168

    169-
    $this->writeArray($example, $depth + 1);
    169+
    $this->writeArray(array_map([Inline::class, 'dump'], $example), $depth + 1);
    170170
    }
    171171

    172172
    if ($children) {

    src/Symfony/Component/Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -42,7 +42,7 @@ public function provideDumpAtPath()
    4242
    # this is a long
    4343
    # multi-line info text
    4444
    # which should be indented
    45-
    child3: ~ # Example: example setting
    45+
    child3: ~ # Example: 'example setting'
    4646
    EOL
    4747
    ],
    4848
    'Regular nested' => ['array.child2', <<<EOL
    @@ -112,7 +112,7 @@ enum: ~ # One of "this"; "that"
    112112
    # this is a long
    113113
    # multi-line info text
    114114
    # which should be indented
    115-
    child3: ~ # Example: example setting
    115+
    child3: ~ # Example: 'example setting'
    116116
    scalar_prototyped: []
    117117
    parameters:
    118118

    src/Symfony/Component/Console/DependencyInjection/AddConsoleCommandPass.php

    Lines changed: 4 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -29,12 +29,14 @@ class AddConsoleCommandPass implements CompilerPassInterface
    2929
    private $commandLoaderServiceId;
    3030
    private $commandTag;
    3131
    private $noPreloadTag;
    32+
    private $privateTagName;
    3233

    33-
    public function __construct(string $commandLoaderServiceId = 'console.command_loader', string $commandTag = 'console.command', string $noPreloadTag = 'container.no_preload')
    34+
    public function __construct(string $commandLoaderServiceId = 'console.command_loader', string $commandTag = 'console.command', string $noPreloadTag = 'container.no_preload', string $privateTagName = 'container.private')
    3435
    {
    3536
    $this->commandLoaderServiceId = $commandLoaderServiceId;
    3637
    $this->commandTag = $commandTag;
    3738
    $this->noPreloadTag = $noPreloadTag;
    39+
    $this->privateTagName = $privateTagName;
    3840
    }
    3941

    4042
    public function process(ContainerBuilder $container)
    @@ -62,7 +64,7 @@ public function process(ContainerBuilder $container)
    6264
    }
    6365

    6466
    if (null === $commandName) {
    65-
    if (!$definition->isPublic() || $definition->isPrivate()) {
    67+
    if (!$definition->isPublic() || $definition->isPrivate() || $definition->hasTag($this->privateTagName)) {
    6668
    $commandId = 'console.command.public_alias.'.$id;
    6769
    $container->setAlias($commandId, $id)->setPublic(true);
    6870
    $id = $commandId;

    src/Symfony/Component/DependencyInjection/Exception/AutowiringFailedException.php

    Lines changed: 3 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -23,7 +23,9 @@ public function __construct(string $serviceId, $message = '', int $code = 0, \Th
    2323
    {
    2424
    $this->serviceId = $serviceId;
    2525

    26-
    if ($message instanceof \Closure && \function_exists('xdebug_is_enabled') && xdebug_is_enabled()) {
    26+
    if ($message instanceof \Closure
    27+
    && (\function_exists('xdebug_is_enabled') ? xdebug_is_enabled() : \function_exists('xdebug_info'))
    28+
    ) {
    2729
    $message = $message();
    2830
    }
    2931

    src/Symfony/Component/Form/Tests/Extension/Core/Type/LocaleTypeTest.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -49,7 +49,7 @@ public function testChoiceTranslationLocaleOption()
    4949
    // Don't check objects for identity
    5050
    $this->assertContainsEquals(new ChoiceView('en', 'en', 'англійська'), $choices);
    5151
    $this->assertContainsEquals(new ChoiceView('en_GB', 'en_GB', 'англійська (Велика Британія)'), $choices);
    52-
    $this->assertContainsEquals(new ChoiceView('zh_Hant_MO', 'zh_Hant_MO', 'китайська (традиційна, Макао, О.А.Р Китаю)'), $choices);
    52+
    $this->assertContainsEquals(new ChoiceView('zh_Hant_TW', 'zh_Hant_TW', 'китайська (традиційна, Тайвань)'), $choices);
    5353
    }
    5454

    5555
    public function testSubmitNull($expected = null, $norm = null, $view = null)

    src/Symfony/Component/HttpFoundation/JsonResponse.php

    Lines changed: 0 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -135,8 +135,6 @@ public function setCallback(string $callback = null)
    135135
    * Sets a raw string containing a JSON document to be sent.
    136136
    *
    137137
    * @return $this
    138-
    *
    139-
    * @throws \InvalidArgumentException
    140138
    */
    141139
    public function setJson(string $json)
    142140
    {

    src/Symfony/Component/HttpFoundation/Request.php

    Lines changed: 1 addition & 13 deletions
    Original file line numberDiff line numberDiff line change
    @@ -516,15 +516,7 @@ public function __clone()
    516516
    */
    517517
    public function __toString()
    518518
    {
    519-
    try {
    520-
    $content = $this->getContent();
    521-
    } catch (\LogicException $e) {
    522-
    if (\PHP_VERSION_ID >= 70400) {
    523-
    throw $e;
    524-
    }
    525-
    526-
    return trigger_error($e, \E_USER_ERROR);
    527-
    }
    519+
    $content = $this->getContent();
    528520

    529521
    $cookieHeader = '';
    530522
    $cookies = [];
    @@ -589,8 +581,6 @@ public function overrideGlobals()
    589581
    *
    590582
    * @param array $proxies A list of trusted proxies, the string 'REMOTE_ADDR' will be replaced with $_SERVER['REMOTE_ADDR']
    591583
    * @param int $trustedHeaderSet A bit field of Request::HEADER_*, to set which headers to trust from your proxies
    592-
    *
    593-
    * @throws \InvalidArgumentException When $trustedHeaderSet is invalid
    594584
    */
    595585
    public static function setTrustedProxies(array $proxies, int $trustedHeaderSet)
    596586
    {
    @@ -1533,8 +1523,6 @@ public function getProtocolVersion()
    15331523
    * @param bool $asResource If true, a resource will be returned
    15341524
    *
    15351525
    * @return string|resource The request body content or a resource to read the body stream
    1536-
    *
    1537-
    * @throws \LogicException
    15381526
    */
    15391527
    public function getContent(bool $asResource = false)
    15401528
    {

    src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php

    Lines changed: 1 addition & 6 deletions
    Original file line numberDiff line numberDiff line change
    @@ -57,12 +57,7 @@ public function collect(Request $request, Response $response, \Throwable $except
    5757
    }
    5858
    }
    5959

    60-
    try {
    61-
    $content = $request->getContent();
    62< 10000 code class="diff-text syntax-highlighted-line deletion">-
    } catch (\LogicException $e) {
    63-
    // the user already got the request content as a resource
    64-
    $content = false;
    65-
    }
    60+
    $content = $request->getContent();
    6661

    6762
    $sessionMetadata = [];
    6863
    $sessionAttributes = [];

    src/Symfony/Component/Intl/Intl.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -125,7 +125,7 @@ public static function getIcuDataVersion(): string
    125125
    */
    126126
    public static function getIcuStubVersion(): string
    127127
    {
    128-
    return '67.1';
    128+
    return '68.1';
    129129
    }
    130130

    131131
    /**

    src/Symfony/Component/Intl/Resources/data/currencies/bg.json

    Lines changed: 6 additions & 6 deletions
    Original file line numberDiff line numberDiff line change
    @@ -226,7 +226,7 @@
    226226
    ],
    227227
    "CNH": [
    228228
    "CNH",
    229-
    "Китайски ренминби юан (offshore)"
    229+
    "Китайски юан (офшорен)"
    230230
    ],
    231231
    "CNY": [
    232232
    "CNY",
    @@ -338,7 +338,7 @@
    338338
    ],
    339339
    "FKP": [
    340340
    "FKP",
    341-
    "Фолклендска лира"
    341+
    "Фолкландска лира"
    342342
    ],
    343343
    "FRF": [
    344344
    "FRF",
    @@ -566,7 +566,7 @@
    566566
    ],
    567567
    "MDL": [
    568568
    "MDL",
    569-
    "Молдовско леу"
    569+
    "Молдовска лея"
    570570
    ],
    571571
    "MGA": [
    572572
    "MGA",
    @@ -586,7 +586,7 @@
    586586
    ],
    587587
    "MMK": [
    588588
    "MMK",
    589-
    "Мианмарски кият"
    589+
    "Мианмарски киат"
    590590
    ],
    591591
    "MNT": [
    592592
    "MNT",
    @@ -618,7 +618,7 @@
    618618
    ],
    619619
    "MWK": [
    620620
    "MWK",
    621-
    "Малавийска квача"
    621+
    "Малавийска куача"
    622622
    ],
    623623
    "MXN": [
    624624
    "MXN",
    @@ -898,7 +898,7 @@
    898898
    ],
    899899
    "UAH": [
    900900
    "UAH",
    901-
    "Украинска хривня"
    901+
    "Украинска гривня"
    902902
    ],
    903903
    "UAK": [
    904904
    "UAK",

    src/Symfony/Component/Intl/Resources/data/currencies/br.json

    Lines changed: 4 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -256,6 +256,10 @@
    256256
    "CLP",
    257257
    "peso Chile"
    258258
    ],
    259+
    "CNH": [
    260+
    "CNH",
    261+
    "yuan Sina (diavaez)"
    262+
    ],
    259263
    "CNX": [
    260264
    "CNX",
    261265
    "dollar Bank poblel Sina"

    src/Symfony/Component/Intl/Resources/data/currencies/bs.json

    Lines changed: 33 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -82,12 +82,16 @@
    8282
    ],
    8383
    "BAD": [
    8484
    "BAD",
    85-
    "Bosansko-Hercegovački dinar"
    85+
    "Bosanskohercegovački dinar"
    8686
    ],
    8787
    "BAM": [
    8888
    "KM",
    8989
    "Bosanskohercegovačka konvertibilna marka"
    9090
    ],
    91+
    "BAN": [
    92+
    "BAN",
    93+
    "Bosanskohercegovački novi dinar"
    94+
    ],
    9195
    "BBD": [
    9296
    "BBD",
    9397
    "Barbadoski dolar"
    @@ -112,6 +116,10 @@
    112116
    "BGL",
    113117
    "Bugarski tvrdi lev"
    114118
    ],
    119+
    "BGM": [
    120+
    "BGM",
    121+
    "Bugarski socijalistički lev"
    122+
    ],
    115123
    "BGN": [
    116124
    "BGN",
    117125
    "Bugarski lev"
    @@ -232,6 +240,10 @@
    232240
    "CHW",
    233241
    "WIR franak"
    234242
    ],
    243+
    "CLE": [
    244+
    "CLE",
    245+
    "Čileanski eskudo"
    246+
    ],
    235247
    "CLF": [
    236248
    "CLF",
    237249
    "Čileanski unidades de fomento"
    @@ -244,6 +256,10 @@
    244256
    "CNH",
    245257
    "Kineski juan (izvanteritorijalni)"
    246258
    ],
    259+
    "CNX": [
    260+
    "CNX",
    261+
    "Dolar kineske narodne banke"
    262+
    ],
    247263
    "CNY": [
    248264
    "CNY",
    249265
    "Kineski juan"
    @@ -252,6 +268,10 @@
    252268
    "COP",
    253269
    "Kolumbijski pezos"
    254270
    ],
    271+
    "COU": [
    272+
    "COU",
    273+
    "Kolumbijski Unidade real de valor"
    274+
    ],
    255275
    "CRC": [
    256276
    "CRC",
    257277
    "Kostarikanski kolon"
    @@ -608,6 +628,14 @@
    608628
    "MAF",
    609629
    "Marokanski franak"
    610630
    ],
    631+
    "MCF": [
    632+
    "MCF",
    633+
    "Monegaskaški franak"
    634+
    ],
    635+
    "MDC": [
    636+
    "MDC",
    637+
    "Moldavski kupon"
    638+
    ],
    611639
    "MDL": [
    612640
    "MDL",
    613641
    "Moldavski lej"
    @@ -1076,6 +1104,10 @@
    10761104
    "YUN",
    10771105
    "Jugoslovenski konvertibilni dinar"
    10781106
    ],
    1107+
    "YUR": [
    1108+
    "YUR",
    1109+
    "Jugoslovenski reformirani dinar"
    1110+
    ],
    10791111
    "ZAL": [
    10801112
    "ZAL",
    10811113
    "Južnoafrički rand (finansijski)"

    0 commit comments

    Comments
     (0)
    0