8000 Merge branch '4.0' · chalasr/symfony@e25e742 · GitHub
[go: up one dir, main page]

Skip to content

Commit e25e742

Browse files
author
Robin Chalas
committed
Merge branch '4.0'
* 4.0: (87 commits) [SecurityBundle] fix setLogoutOnUserChange calls for context listeners [SecurityBundle] add note to info text of no-op config option logout_on_user_change fixed tests fixed typo [DI] Register singly-implemented interfaces when doing PSR-4 discovery [Security] Adding a GuardAuthenticatorHandler alias fixed tests moved method to function marked method as being internal [FrameworkBundle] Fix a bug where a color tag will be shown when passing an antislash [DI] Fix missing unset leading to false-positive circular ref [DI] Fix deep-inlining of non-shared refs parse newlines in quoted multiline strings Fix collision between view properties and form fields Fix collision between view properties and form fields Disallow viewing dot-files in Profiler [SecurityBundle] Fix compat with HttpFoundation >=3.4 SCA with Php Inspections (EA Extended) Fix for missing whitespace control modifier in form layout Add test case for symfony#25264 ...
2 parents 18dd63a + fa42a0c commit e25e742

File tree

127 files changed

+1919
-626
lines changed
  • Tests/Input
  • DependencyInjection
  • Dotenv
  • Form
  • HttpFoundation
  • HttpKernel
  • Intl/NumberFormatter
  • Security
  • Serializer
  • Translation/DependencyInjection
  • Validator
  • VarDumper
  • Workflow
  • Yaml
  • Some content is hidden

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

    127 files changed

    +1919
    -626
    lines changed

    CHANGELOG-4.0.md

    Lines changed: 42 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -7,6 +7,48 @@ in 4.0 minor versions.
    77
    To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
    88
    To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v4.0.0...v4.0.1
    99

    10+
    * 4.0.0 (2017-11-30)
    11+
    12+
    * bug #25220 [HttpFoundation] Add Session::isEmpty(), fix MockFileSessionStorage to behave like the native one (nicolas-grekas)
    13+
    * bug #25209 [VarDumper] Dont use empty(), it chokes on eg GMP objects (nicolas-grekas)
    14+
    * bug #25200 [HttpKernel] Arrays with scalar values passed to ESI fragment renderer throw deprecation notice (Simperfit)
    15+
    * bug #25201 [HttpKernel] Add a better error messages when passing a private or non-tagged controller (Simperfit)
    16+
    * bug #25155 [DependencyInjection] Detect case mismatch in autowiring (Simperfit, sroze)
    17+
    * bug #25217 [Dotenv] Changed preg_match flags from null to 0 (deekthesqueak)
    18+
    * bug #25180 [DI] Fix circular reference when using setters (nicolas-grekas)
    19+
    * bug #25204 [DI] Clear service reference graph (nicolas-grekas)
    20+
    * bug #25203 [DI] Fix infinite loop in InlineServiceDefinitionsPass (nicolas-grekas)
    21+
    * bug #25185 [Serializer] Do not cache attributes if `attributes` in context (sroze)
    22+
    * bug #25190 [HttpKernel] Keep legacy container files for concurrent requests (nicolas-grekas)
    23+
    * bug #25182 [HttpFoundation] AutExpireFlashBag should not clear new flashes (Simperfit, sroze)
    24+
    * bug #25174 [Translation] modify definitions only if the do exist (xabbuh)
    25+
    * bug #25179 [FrameworkBundle][Serializer] Remove YamlEncoder definition if Yaml component isn't installed (ogizanagi)
    26+
    * bug #25160 [DI] Prevent a ReflectionException during cache:clear when the parent class doesn't exist (dunglas)
    27+
    * bug #25163 [DI] Fix tracking of env vars in exceptions (nicolas-grekas)
    28+
    * bug #25162 [HttpKernel] Read $_ENV when checking SHELL_VERBOSITY (nicolas-grekas)
    29+
    * bug #25158 [DI] Remove unreachable code (GawainLynch)
    30+
    * bug #25152 [Form] Don't rely on `Symfony\Component\HttpFoundation\File\File` if http-foundation isn't in FileType (issei-m)
    31+
    * bug #24987 [Console] Fix global console flag when used in chain (Simperfit)
    32+
    * bug #25137 Adding checks for the expression language (weaverryan)
    33+
    * bug #25151 [FrameworkBundle] Automatically enable the CSRF protection if CSRF manager exists (sroze)
    34+
    * bug #25043 [Yaml] added ability for substitute aliases when mapping is on single line (Michał Strzelecki, xabbuh)
    35+
    36+
    * 4.0.0-RC2 (2017-11-24)
    37+
    38+
    * bug #25146 [DI] Dont resolve envs in service ids (nicolas-grekas)
    39+
    * bug #25113 [Routing] Fix "config-file-relative" annotation loader resources (nicolas-grekas, sroze)
    40+
    * bug #25065 [FrameworkBundle] Update translation commands to work with default paths (yceruto)
    41+
    * bug #25109 Make debug:container search command case-insensitive (jzawadzki)
    42+
    * bug #25121 [FrameworkBundle] Fix AssetsInstallCommand (nicolas-grekas)
    43+
    * bug #25102 [Form] Fixed ContextErrorException in FileType (chihiro-adachi)
    44+
    * bug #25130 [DI] Fix handling of inlined definitions by ContainerBuilder (nicolas-grekas)
    45+
    * bug #25119 [DI] Fix infinite loop when analyzing references (nicolas-grekas)
    46+
    * bug #25094 [FrameworkBundle][DX] Display a nice error message if an enabled component is missing (derrabus)
    47+
    * bug #25100 [SecurityBundle] providerIds is undefined error when firewall provider is not specified (karser)
    48+
    * bug #25100 [SecurityBundle] providerIds is undefined error when firewall provider is not specified (karser)
    49+
    * bug #25100 [SecurityBundle] providerIds is undefined error when firewall provider is not specified (karser)
    50+
    * bug #25097 [Bridge\PhpUnit] Turn "preserveGlobalState" to false by default, revert "Blacklist" removal (nicolas-grekas)
    51+
    1052
    * 4.0.0-RC1 (2017-11-21)
    1153

    1254
    * bug #25077 [Bridge/Twig] Let getFlashes starts the session (MatTheCat)

    UPGRADE-4.0.md

    Lines changed: 0 additions & 6 deletions
    Original file line numberDiff line numberDiff line change
    @@ -598,12 +598,6 @@ HttpKernel
    598598
    tags: ['console.command']
    599599
    ```
    600600
    601-
    * Removed the `kernel.root_dir` parameter. Use the `kernel.project_dir` parameter
    602-
    instead.
    603-
    604-
    * Removed the `Kernel::getRootDir()` method. Use the `Kernel::getProjectDir()`
    605-
    method instead.
    606-
    607601
    * The `Extension::addClassesToCompile()` and `Extension::getClassesToCompile()` methods have been removed.
    608602

    609603
    * Possibility to pass non-scalar values as URI attributes to the ESI and SSI

    link

    Lines changed: 9 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -35,11 +35,14 @@ if (!is_dir("$argv[1]/vendor/symfony")) {
    3535
    }
    3636

    3737
    $sfPackages = array('symfony/symfony' => __DIR__);
    38+
    39+
    $filesystem = new Filesystem();
    3840
    foreach (glob(__DIR__.'/src/Symfony/{Bundle,Bridge,Component,Component/Security}/*', GLOB_BRACE | GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {
    39-
    $sfPackages[json_decode(file_get_contents("$dir/composer.json"))->name] = $dir;
    41+
    if ($filesystem->exists($composer = "$dir/composer.json")) {
    42+
    $sfPackages[json_decode(file_get_contents($composer))->name] = $dir;
    43+
    }
    4044
    }
    4145

    42-
    $filesystem = new Filesystem();
    4346
    foreach (glob("$argv[1]/vendor/symfony/*", GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {
    4447
    $package = 'symfony/'.basename($dir);
    4548
    if (is_link($dir)) {
    @@ -57,3 +60,7 @@ foreach (glob("$argv[1]/vendor/symfony/*", GLOB_ONLYDIR | GLOB_NOSORT) as $dir)
    5760
    $filesystem->symlink($sfDir, $dir);
    5861
    echo "\"$package\" has been linked to \"$sfPackages[$package]\".".PHP_EOL;
    5962
    }
    63+
    64+
    foreach (glob("$argv[1]/var/cache/*") as $cacheDir) {
    65+
    $filesystem->remove($cacheDir);
    66+
    }

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

    Lines changed: 7 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -27,7 +27,7 @@ if (PHP_VERSION_ID >= 70200) {
    2727
    }
    2828

    2929
    $root = __DIR__;
    30-
    while (!file_exists($root.'/composer.json') || file_exists($root.'/bin/simple-phpunit')) {
    30+
    while (!file_exists($root.'/composer.json') || file_exists($root.'/DeprecationErrorHandler.php')) {
    3131
    if ($root === dirname($root)) {
    3232
    break;
    3333
    }
    @@ -59,7 +59,12 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
    5959
    passthru(sprintf('\\' === DIRECTORY_SEPARATOR ? '(del /S /F /Q %s & rmdir %1$s) >nul': 'rm -rf %s', "phpunit-$PHPUNIT_VERSION"));
    6060
    }
    6161
    if (extension_loaded('openssl') && ini_get('allow_url_fopen') && !isset($_SERVER['http_proxy']) && !isset($_SERVER['https_proxy'])) {
    62-
    stream_copy_to_stream(fopen("https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip", 'rb'), fopen("$PHPUNIT_VERSION.zip", 'wb'));
    62+
    $remoteZip = "https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip";
    63+
    $remoteZipStream = @fopen($remoteZip, 'rb');
    64+
    if (!$remoteZipStream) {
    65+
    throw new \RuntimeException("Could not find $remoteZip");
    66+
    }
    67+
    stream_copy_to_stream($remoteZipStream, fopen("$PHPUNIT_VERSION.zip", 'wb'));
    6368
    } else {
    6469
    @unlink("$PHPUNIT_VERSION.zip");
    6570
    passthru("wget https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip");

    src/Symfony/Bridge/Twig/Extension/FormExtension.php

    Lines changed: 10 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -13,6 +13,7 @@
    1313

    1414
    use Symfony\Bridge\Twig\TokenParser\FormThemeTokenParser;
    1515
    use Symfony\Component\Form\ChoiceList\View\ChoiceView;
    16+
    use Symfony\Component\Form\FormView;
    1617
    use Twig\Extension\AbstractExtension;
    1718
    use Twig\TwigFilter;
    1819
    use Twig\TwigFunction;
    @@ -72,6 +73,7 @@ public function getTests()
    7273
    {
    7374
    return array(
    7475
    new TwigTest('selectedchoice', 'Symfony\Bridge\Twig\Extension\twig_is_selected_choice'),
    76+
    new TwigTest('rootform', 'Symfony\Bridge\Twig\Extension\twig_is_root_form'),
    7577
    );
    7678
    }
    7779

    @@ -103,3 +105,11 @@ function twig_is_selected_choice(ChoiceView $choice, $selectedValue)
    103105

    104106
    return $choice->value === $selectedValue;
    105107
    }
    108+
    109+
    /**
    110+
    * @internal
    111+
    */
    112+
    function twig_is_root_form(FormView $formView)
    113+
    {
    114+
    return null === $formView->parent;
    115+
    }

    src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -140,12 +140,12 @@
    140140

    141141
    {% block form_errors -%}
    142142
    {% if errors|length > 0 -%}
    143-
    {% if form.parent %}<span class="help-block">{% else %}<div class="alert alert-danger">{% endif %}
    143+
    {% if form is not rootform %}<span class="help-block">{% else %}<div class="alert alert-danger">{% endif %}
    144144
    <ul class="list-unstyled">
    145145
    {%- for error in errors -%}
    146146
    <li><span class="glyphicon glyphicon-exclamation-sign"></span> {{ error.message }}</li>
    147147
    {%- endfor -%}
    148148
    </ul>
    149-
    {% if form.parent %}</span>{% else %}</div>{% endif %}
    149+
    {% if form is not rootform %}</span>{% else %}</div>{% endif %}
    150150
    {%- endif %}
    151151
    {%- endblock form_errors %}

    src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -173,7 +173,7 @@
    173173

    174174
    {% block form_errors -%}
    175175
    {%- if errors|length > 0 -%}
    176-
    <div class="{% if form.parent %}invalid-feedback{% else %}alert alert-danger{% endif %}">
    176+
    <div class="{% if form is not rootform %}invalid-feedback{% else %}alert alert-danger{% endif %}">
    177177
    <ul class="list-unstyled mb-0">
    178178
    {%- for error in errors -%}
    179179
    <li>{{ error.message }}</li>

    src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig

    Lines changed: 4 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -15,7 +15,7 @@
    1515

    1616
    {%- block form_widget_compound -%}
    1717
    <div {{ block('widget_container_attributes') }}>
    18-
    {%- if form.parent is empty -%}
    18+
    {%- if form is rootform -%}
    1919
    {{ form_errors(form) }}
    2020
    {%- endif -%}
    2121
    {{- block('form_rows') -}}
    @@ -347,9 +347,9 @@
    347347
    {% if not child.rendered %}
    348348
    {{- form_row(child) -}}
    349349
    {% endif %}
    350-
    {%- endfor %}
    350+
    {%- endfor -%}
    351351

    352-
    {% if not form.methodRendered and form.parent is null %}
    352+
    {% if not form.methodRendered and form is rootform %}
    353353
    {%- do form.setMethodRendered() -%}
    354354
    {% set method = method|upper %}
    355355
    {%- if method in ["GET", "POST"] -%}
    @@ -361,7 +361,7 @@
    361361
    {%- if form_method != method -%}
    362362
    <input type="hidden" name="_method" value="{{ method }}" />
    363363
    {%- endif -%}
    364-
    {% endif %}
    364+
    {% endif -%}
    365365
    {% endblock form_rest %}
    366366

    367367
    {# Support #}

    src/Symfony/Bridge/Twig/Resources/views/Form/form_table_layout.html.twig

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -31,7 +31,7 @@
    3131

    3232
    {%- block form_widget_compound -%}
    3333
    <table {{ block('widget_container_attributes') }}>
    34-
    {%- if form.parent is empty and errors|length > 0 -%}
    34+
    {%- if form is rootform and errors|length > 0 -%}
    3535
    <tr>
    3636
    <td colspan="2">
    3737
    {{- form_errors(form) -}}

    src/Symfony/Bridge/Twig/Resources/views/Form/foundation_5_layout.html.twig

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -318,11 +318,11 @@
    318318

    319319
    {% block form_errors -%}
    320320
    {% if errors|length > 0 -%}
    321-
    {% if form.parent %}<small class="error">{% else %}<div data-alert class="alert-box alert">{% endif %}
    321+
    {% if form is not rootform %}<small class="error">{% else %}<div data-alert class="alert-box alert">{% endif %}
    322322
    {%- for error in errors -%}
    323323
    {{ error.message }}
    324324
    {% if not loop.last %}, {% endif %}
    325325
    {%- endfor -%}
    326-
    {% if form.parent %}</small>{% else %}</div>{% endif %}
    326+
    {% if form is not rootform %}</small>{% else %}</div>{% endif %}
    327327
    {%- endif %}
    328328
    {%- endblock form_errors %}

    0 commit comments

    Comments
     (0)
    0