Skip to content
Permalink
Branch: master
Commits on Mar 15, 2019
  1. Merge branch '4.2'

    nicolas-grekas committed Mar 15, 2019
    * 4.2:
      Fix Cache error while using anonymous class
      [Cache] fix LockRegistry
      Update validators.cs.xlf
      Make translations consistent with other translations.
      Correct language code for ukrainian language in security translations.
      Fix return type of Request::getRequestFormat
      [Cache] Fix perf when using RedisCluster by reducing roundtrips to the servers
  2. Merge branch '3.4' into 4.2

    nicolas-grekas committed Mar 15, 2019
    * 3.4:
      Fix Cache error while using anonymous class
      Update validators.cs.xlf
  3. bug #30487 Fix Cache error while using anonymous class (Emmanuel BORGES)

    nicolas-grekas committed Mar 15, 2019
    This PR was merged into the 3.4 branch.
    
    Discussion
    ----------
    
    Fix Cache error while using anonymous class
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 4.2
    | Bug fix?      | yes
    | New feature?  | no
    | BC breaks?    | no
    | Deprecations? | no
    | Tests pass?   | yes
    | Fixed tickets | #30395
    | License       | MIT
    
    Fix Cache error while using anonymous class
    
    Commits
    -------
    
    036e722 Fix Cache error while using anonymous class
  4. feature #30348 [DependencyInjection] Add ability to define an index f…

    nicolas-grekas committed Mar 15, 2019
    …or service in an injected service locator argument (XuruDragon, nicolas-grekas)
    
    This PR was merged into the 4.3-dev branch.
    
    Discussion
    ----------
    
    [DependencyInjection] Add ability to define an index for service in an injected service locator argument
    
    | Q             | A
    | ------------- | ---
    | Branch?       | master
    | Bug fix?      | no
    | New feature?  | yes
    | BC breaks?    | no
    | Deprecations? | no
    | Tests pass?   | yes
    | Fixed tickets | n/a
    | License       | MIT
    | Doc PR        | in progress /  symfony/symfony-docs#...
    
    It's more or less the same thing then the PR #30257 but for a service locator argument
    
    Add a simple way to specify an index based on a tag attribute to simplify retrieving a specific service when injecting a service locator as argument into services, but also a way to fallback to a static method on the service class.
    
    Yaml:
    ```yaml
    services:
      foo_service:
        class: Foo
        tags:
          - {name: foo_tag, key: foo_service}
      foo_service_tagged:
        class: Bar
        arguments:
          - !tagged_locator
              tag: 'foo_tag'
              index_by: 'key'
              default_index_method: 'static_method'
    ```
    XML:
    ```xml
    <?xml version="1.0" ?>
    
    <container xmlns="http://symfony.com/schema/dic/services"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://symfony.com/schema/dic/services
        http://symfony.com/schema/dic/services/services-1.0.xsd">
      <services>
        <service id="foo" class="Foo">
            <tag name="foo_tag" key="foo_service" />
        </service>
        <service id="foo_tagged_iterator" class="Bar" public="true">
          <argument type="tagged_locator" tag="foo_tag" index-by="key" default-index-method="static_method" />
        </service>
      </services>
    </container>
    ```
    PHP:
    ```php
    // config/services.php
    use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument;
    use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
    
    $container->register(Foo::class)
            ->addTag('foo_tag', ['key' => 'foo_service']);
    
    $container->register(App\Handler\HandlerCollection::class)
             // inject all services tagged with app.handler as first argument
             ->addArgument(new ServiceLocatorArgument(new TaggedIteratorArgument('app.handler', 'key')));
    ```
    
    Usage:
    ```php
    // src/Handler/HandlerCollection.php
    namespace App\Handler;
    
    use Symfony\Component\DependencyInjection\ServiceLocator;
    
    class HandlerCollection
    {
         public function __construct(ServiceLocator $serviceLocator)
         {
               $foo = $serviceLocator->get('foo_service'):
         }
    }
    ```
    
    Tasks
    
    * [x]  Support PHP loader/dumper
    * [x]  Support YAML loader/dumper
    * [x]  Support XML loader/dumper (and update XSD too)
    * [x]  Add tests
    * [x]  Documentation
    
    Commits
    -------
    
    cb3c56b Support indexing tagged locators by FQCN as fallback
    250a2c8 [DI] Allow tagged_locator tag to be used as an argument
  5. feature #30469 Create a hyperlink to interfaces/classes that can be a…

    nicolas-grekas committed Mar 15, 2019
    …utowired (SerkanYildiz)
    
    This PR was squashed before being merged into the 4.3-dev branch (closes #30469).
    
    Discussion
    ----------
    
    Create a hyperlink to interfaces/classes that can be autowired
    
    | Q             | A
    | ------------- | ---
    | Branch?       | master
    | Bug fix?      | no
    | New feature?  | yes
    | BC breaks?    | no
    | Deprecations? | no
    | Tests pass?   | yes
    | License       | MIT
    
    Added hyperlink to definition of interfaces/classes that can be used for autowiring.
    But I need help with:
    - the aliases are becoming hyperlinks too, but shouldn't.
    It's outputting `<fg=yellow;href=phpstorm://open?file=filepath&line=17>Symfony\Contracts\Translation\TranslatorInterface</> <fg=cyan>(translator.default)</>`
    
    - it currently works with phpstorm because it's hardcoded but it should work with framework.ide option, but don't know what the best approach is to support that config option.
    
    Commits
    -------
    
    a3dfcee Create a hyperlink to interfaces/classes that can be autowired
  6. bug #30576 [Cache] fix LockRegistry (nicolas-grekas)

    nicolas-grekas committed Mar 15, 2019
    This PR was merged into the 4.2 branch.
    
    Discussion
    ----------
    
    [Cache] fix LockRegistry
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 4.2
    | Bug fix?      | yes
    | New feature?  | no
    | BC breaks?    | no
    | Deprecations? | no
    | Tests pass?   | yes
    | Fixed tickets | -
    | License       | MIT
    | Doc PR        | -
    
    - Locking doesn't work right now, because of this missing return statement.
    I can't provide a useful test case, because this is effective only when race conditions happen...
    - Writing the value should happen within the boundaries of the lock.
    - The `final` keyword is really missing, there are zero reasons to extend this class, adding it asap will make it clear and will unlock progress on this class.
    - Lastly, a type-hint fix is shipped here also.
    
    Commits
    -------
    
    f49df4a [Cache] fix LockRegistry
  7. feature #30334 [DI] add ReverseContainer: a locator that turns servic…

    nicolas-grekas committed Mar 15, 2019
    …es back to their ids (nicolas-grekas)
    
    This PR was merged into the 4.3-dev branch.
    
    Discussion
    ----------
    
    [DI] add ReverseContainer: a locator that turns services back to their ids
    
    | Q             | A
    | ------------- | ---
    | Branch?       | master
    | Bug fix?      | no
    | New feature?  | yes
    | BC breaks?    | no
    | Deprecations? | no
    | Tests pass?   | yes
    | Fixed tickets | -
    | License       | MIT
    | Doc PR        | -
    
    This PR introduces a `ReverseContainer`, which is a class you can type hint for to get it as a service.
    
    When you have a `ReverseContainer` at hand, you can then use it to know the service id of an object (if the object is not found, `null` is returned):
    `$id = $reverseContainer->getId($someObject);`
    
    You can also call `$reverseContainer->getService($id);` and get the service in return.
    
    To be reversible, a service must either be public or be tagged with `container.reversible`.
    
    I'm using this feature to serialize service references in a message, then send them through a Messenger bus, allowing the handler on the other side to use that referenced service to process the message. More specifically, my use case is sending messages for early cache expiration events through a bus and have a worker compute the soon-to-expire value in the background. The reversible services are the computation callbacks and the cache pools I need to compute the value for.
    
    Commits
    -------
    
    ac1e429 [DI] add ReverseContainer: a locator that turns services back to their ids
  8. feature #30539 [Messenger] deprecate LoggingMiddleware in favor of pr…

    nicolas-grekas committed Mar 15, 2019
    …oviding a logger to SendMessageMiddleware (nicolas-grekas)
    
    This PR was merged into the 4.3-dev branch.
    
    Discussion
    ----------
    
    [Messenger] deprecate LoggingMiddleware in favor of providing a logger to SendMessageMiddleware
    
    | Q             | A
    | ------------- | ---
    | Branch?       | master
    | Bug fix?      | no
    | New feature?  | yes
    | BC breaks?    | no
    | Deprecations? | yes
    | Tests pass?   | yes
    | Fixed tickets | -
    | License       | MIT
    | Doc PR        | -
    
    Discussing with @simensen, we figured out the currently logged messages are not precise enough.
    Logging is a cross-cutting concern: splitting it in a dedicated middleware means losing details - or building complexity.
    Let's make things simple and log the best messages depending on the internal situation.
    
    While the component is experimental, removing the `LoggingMiddleware` altogether would break FrameworkBundle 4.2 when it is used with Messenger 4.3. Not worth the trouble when it's two lines to deprecate IMHO.
    
    Commits
    -------
    
    2bff625 [Messenger] deprecate LoggingMiddleware in favor of providing a logger to SendMessageMiddleware
  9. minor #30561 [HttpClient] strengthen bearer validation (nicolas-grekas)

    nicolas-grekas committed Mar 15, 2019
    This PR was merged into the 4.3-dev branch.
    
    Discussion
    ----------
    
    [HttpClient] strengthen bearer validation
    
    | Q             | A
    | ------------- | ---
    | Branch?       | master
    | Bug fix?      | yes
    | New feature?  | no
    | BC breaks?    | no
    | Deprecations? | no
    | Tests pass?   | yes
    | Fixed tickets | -
    | License       | MIT
    | Doc PR        | -
    
    Better be sure CR/LF/etc cannot be passed inside raw header values, opening potential security risks.
    
    Commits
    -------
    
    e6e1620 [HttpClient] strengthen bearer validation
  10. [Cache] fix LockRegistry

    nicolas-grekas committed Mar 14, 2019
Commits on Mar 14, 2019
  1. [DI] add ReverseContainer: a locator that turns services back to thei…

    nicolas-grekas committed Feb 21, 2019
    …r ids
  2. [HttpClient] strengthen bearer validation

    nicolas-grekas committed Mar 14, 2019
  3. minor #30564 [HttpClient] Fix HttpOptions::setAuthBearer() (dunglas)

    nicolas-grekas committed Mar 14, 2019
    This PR was merged into the 4.3-dev branch.
    
    Discussion
    ----------
    
    [HttpClient] Fix HttpOptions::setAuthBearer()
    
    | Q             | A
    | ------------- | ---
    | Branch?       | master <!-- see below -->
    | Bug fix?      | yes
    | New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
    | BC breaks?    | no     <!-- see https://symfony.com/bc -->
    | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
    | Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
    | Fixed tickets | n/a   <!-- #-prefixed issue number(s), if any -->
    | License       | MIT
    | Doc PR        | n/a
    
    I messed up the option name while rebasing...
    
    Commits
    -------
    
    7308e5a [HttpClient] Fix HttpOptions::setAuthBearer()
  4. [Messenger] deprecate LoggingMiddleware in favor of providing a logge…

    nicolas-grekas committed Mar 12, 2019
    …r to SendMessageMiddleware
  5. [EventDispatcher] swap arguments of dispatch() to allow registering e…

    nicolas-grekas committed Oct 18, 2018
    …vents by FQCN
Commits on Mar 13, 2019
  1. Merge branch '3.4' into 4.2

    nicolas-grekas committed Mar 13, 2019
    * 3.4:
      Make translations consistent with other translations.
      Correct language code for ukrainian language in security translations.
      Fix return type of Request::getRequestFormat
      [Cache] Fix perf when using RedisCluster by reducing roundtrips to the servers
  2. minor #30552 Fixed typo (lyrixx)

    nicolas-grekas committed Mar 13, 2019
    This PR was merged into the 4.3-dev branch.
    
    Discussion
    ----------
    
    Fixed typo
    
    | Q             | A
    | ------------- | ---
    | Branch?       | master
    | Bug fix?      | no
    | New feature?  | no
    | BC breaks?    | no
    | Deprecations? | no
    | Tests pass?   | yes
    | Fixed tickets |
    | License       | MIT
    | Doc PR        |
    
    Commits
    -------
    
    82bb4ae Fixed typo
  3. bug #30548 Correct language code for ukrainian language (stanleyk)

    nicolas-grekas committed Mar 13, 2019
    This PR was merged into the 3.4 branch.
    
    Discussion
    ----------
    
    Correct language code for ukrainian language
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 3.4
    | Bug fix?      | yes
    | New feature?  | no
    | BC breaks?    | yes
    | Deprecations? | no
    | Tests pass?   | yes
    | Fixed tickets |
    | License       | MIT
    | Doc PR        |
    
    Correct language code for [ukrainian language](https://en.wikipedia.org/wiki/Ukrainian_language) is **uk**, not **ua**. Similar bug was earlier addressed in #5972, but somehow it appeared here again. Possible BC break in case someone relies on "ua" version being present, but I think that is a minor problem.
    
    Commits
    -------
    
    b86fa93 Correct language code for ukrainian language in security translations.
  4. minor #30550 [Validator] Improve Bulgarian translations. (moynzzz)

    nicolas-grekas committed Mar 13, 2019
    This PR was merged into the 3.4 branch.
    
    Discussion
    ----------
    
    [Validator] Improve Bulgarian translations.
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 3.4 <!-- see below -->
    | Bug fix?      | no
    | New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
    | BC breaks?    | no     <!-- see https://symfony.com/bc -->
    | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
    | Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
    | Fixed tickets | none   <!-- #-prefixed issue number(s), if any -->
    | License       | MIT
    | Doc PR        | none <!-- required for new features -->
    
    <!--
    Write a short README entry for your feature/bugfix here (replace this comment block.)
    This will help people understand your PR and can be used as a start of the Doc PR.
    Additionally:
     - Bug fixes must be submitted against the lowest branch where they apply
       (lowest branches are regularly merged to upper ones so they get the fixes too).
     - Features and deprecations must be submitted against the master branch.
    -->
    
    This pull request is an improvement on top of #30227 and improves translations in the following ways:
    
    - Make consistent how `This` word is translated.
    - Make consistent how `This value` is translated.
    - Fix capitalization rules for abbreviations.
    - Change `email` to `имейл` (this is a word in the official Bulgarian dictionary).
    - Removes unnecessary words in brackets.
    
    Feel free to comment and criticize I'm not a professional translator.
    
    Commits
    -------
    
    d15c76c Make translations consistent with other translations.
  5. bug #30518 [Cache] Fix perf when using RedisCluster by reducing round…

    nicolas-grekas committed Mar 13, 2019
    …trips to the servers (nicolas-grekas)
    
    This PR was merged into the 3.4 branch.
    
    Discussion
    ----------
    
    [Cache] Fix perf when using RedisCluster by reducing roundtrips to the servers
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 3.4
    | Bug fix?      | yes
    | New feature?  | no
    | BC breaks?    | no
    | Deprecations? | no
    | Tests pass?   | yes
    | License       | MIT
    
    This is slimmed down version of: #28269 _(many of the fixes there are already part of 3.4)_
    
    Does:
    - Adds test coverage for Predis with RedisCluster
    - Removes usage of key versioning when on RedisCluster, besides performance aspect of that it simplifies / aligning clear() handling across all clients
    - reuse doDelete() from clear to make sure we call singular del calls when in predis cluster
    
    Commits
    -------
    
    dacf179 [Cache] Fix perf when using RedisCluster by reducing roundtrips to the servers
  6. bug #30509 [Form] Fix debug form when using partial type name (yceruto)

    nicolas-grekas committed Mar 13, 2019
    This PR was merged into the 4.3-dev branch.
    
    Discussion
    ----------
    
    [Form] Fix debug form when using partial type name
    
    | Q             | A
    | ------------- | ---
    | Branch?       | master
    | Bug fix?      | yes
    | New feature?  | no
    | BC breaks?    | no
    | Deprecations? | no
    | Tests pass?   | yes
    | Fixed tickets | -
    | License       | MIT
    
    Since #29452 (4.3) we have the possibility of passing a partial type name. This fixes the case where `debug:form dateTime` doesn't work as expected:
    ```bash
    In FormRegistry.php line 89:
    
      [Symfony\Component\Form\Exception\InvalidArgumentException]
      Could not load type "dateTime": class does not implement "Symfony\Component\Form\FormTypeInterface".
    ```
    
    Commits
    -------
    
    22b20ca Fix debug:form dateTime
  7. Rebase and update to latest CS

    nicolas-grekas committed Mar 13, 2019
  8. minor #30535 Fix return type of Request::getRequestFormat (teohhanhui)

    nicolas-grekas committed Mar 13, 2019
    This PR was merged into the 3.4 branch.
    
    Discussion
    ----------
    
    Fix return type of Request::getRequestFormat
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 3.4
    | Bug fix?      | yes
    | New feature?  | no
    | BC breaks?    | no
    | Deprecations? | no
    | Tests pass?   | yes
    | Fixed tickets | N/A
    | License       | MIT
    | Doc PR        | N/A
    
    Helps static analysis tools get the correct type.
    
    Commits
    -------
    
    bd92349 Fix return type of Request::getRequestFormat
  9. feature #29303 [Messenger] add welcome notice when running the comman…

    nicolas-grekas committed Mar 13, 2019
    …d (nicolas-grekas)
    
    This PR was merged into the 4.3-dev branch.
    
    Discussion
    ----------
    
    [Messenger] add welcome notice when running the command
    
    | Q             | A
    | ------------- | ---
    | Branch?       | master
    | Bug fix?      | no
    | New feature?  | yes
    | BC breaks?    | no
    | Deprecations? | no
    | Tests pass?   | yes
    | Fixed tickets | -
    | License       | MIT
    | Doc PR        | -
    
    The current behavior of `./bin/console messenger:consume-messages` is totally silent: you run it and nothing visible happens.
    
    Here is what is displayed with this PR:
    ![image](https://user-images.githubusercontent.com/243674/54235039-af0a6c80-4510-11e9-89d8-3c1c55e946c0.png)
    
    Combined with #30539, it gives:
    ![image](https://user-images.githubusercontent.com/243674/54235156-ed079080-4510-11e9-9d4d-9f27c87e16e5.png)
    
    Commits
    -------
    
    673b58b [Messenger] add welcome notice when running the command
  10. [Messenger] add welcome notice when running the command

    nicolas-grekas committed Nov 24, 2018
Commits on Mar 12, 2019
  1. Merge branch '4.2'

    nicolas-grekas committed Mar 12, 2019
    * 4.2:
      Fix README about BC promise
      Fixed typo
  2. minor #30538 [Messenger] Fix README about BC promise (nicolas-grekas)

    nicolas-grekas committed Mar 12, 2019
    This PR was merged into the 4.2 branch.
    
    Discussion
    ----------
    
    [Messenger] Fix README about BC promise
    
    | Q             | A
    | ------------- | ---
    | Branch?       | master
    | Bug fix?      | no
    | New feature?  | yes
    | BC breaks?    | no
    | Deprecations? | no
    | Tests pass?   | yes
    | Fixed tickets | -
    | License       | MIT
    | Doc PR        | -
    
    We don't have a BC *break* policy :)
    Should be applied to MIME and HttpClient when merging into master.
    
    Commits
    -------
    
    9b2af69 Fix README about BC promise
  3. Fix README about BC promise

    nicolas-grekas committed Mar 12, 2019
  4. minor #30533 Fixed typo (lyrixx)

    nicolas-grekas committed Mar 12, 2019
    This PR was merged into the 4.2 branch.
    
    Discussion
    ----------
    
    Fixed typo
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 4.2
    | Bug fix?      | no
    | New feature?  | no
    | BC breaks?    | no
    | Deprecations? | no>
    | Tests pass?   | yes
    | Fixed tickets |
    | License       | MIT
    | Doc PR        |
    
    ---
    
    cc @pborreli
    
    Commits
    -------
    
    ae0adf1 Fixed typo
  5. bug #30513 [HttpClient] yield a last chunk for completed responses al…

    nicolas-grekas committed Mar 12, 2019
    …so (nicolas-grekas)
    
    This PR was merged into the 4.3-dev branch.
    
    Discussion
    ----------
    
    [HttpClient] yield a last chunk for completed responses also
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 3.4
    | Bug fix?      | yes
    | New feature?  | no
    | BC breaks?    | no
    | Deprecations? | no
    | Tests pass?   | yes
    | Fixed tickets | -
    | License       | MIT
    | Doc PR        | -
    
    When a response completed, streaming it again yields no chunks right now.
    This PR makes it yield a `LastChunk` - or an `ErrorChunk` when applicable.
    The reasoning for the previous behavior was that streams should yield only activity from the network.
    But this looks more complex to use in practice. The proposed behavior is simpler to reason about I think.
    
    Commits
    -------
    
    e11ef7e [HttpClient] yield a last chunk for completed responses also
Commits on Mar 11, 2019
  1. Merge branch '4.2'

    nicolas-grekas committed Mar 11, 2019
    * 4.2:
      [Cache] Only delete one key at a time when on Predis + Cluster
      [Validator] Add missing translations for Swedish locale
      [Process] fix using argument $php of new PhpProcess()
      [Routing] removed a useless var
      [Routing] Fixed XML options resolution
  2. [Cache] Fix perf when using RedisCluster by reducing roundtrips to th…

    nicolas-grekas authored and andrerom committed Aug 26, 2018
    …e servers
    
    This is slimmed down version of: #28269 _(many of the fixes here are already part of 3.4)_
    
    Adds:
    - Test coverage for Predis with RedisCluster
    - Removes usage of key versioning when on RedisCluster, besides performance aspect of that simplify / aligning clear() handling across cases
  3. Support indexing tagged locators by FQCN as fallback

    nicolas-grekas authored and XuruDragon committed Mar 7, 2019
  4. Merge branch '3.4' into 4.2

    nicolas-grekas committed Mar 11, 2019
    * 3.4:
      [Cache] Only delete one key at a time when on Predis + Cluster
      [Validator] Add missing translations for Swedish locale
      [Routing] removed a useless var
      [Routing] Fixed XML options resolution
  5. bug #30515 [Cache] Only delete one key at a time when on Predis + Clu…

    nicolas-grekas committed Mar 11, 2019
    …ster (andrerom)
    
    This PR was merged into the 3.4 branch.
    
    Discussion
    ----------
    
    [Cache] Only delete one key at a time when on Predis + Cluster
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 3.4
    | Bug fix?      | yes
    | New feature?  | no
    | BC breaks?    | no
    | Deprecations? | no
    | Tests pass?   | yes
    | License       | MIT
    
    Makes sure deletes when on Predis  Cluster is only done one by one as it's not able to send the keys to right cluster node like RedisCluster can.
    
    _This is backport of logic from 4.x to fix this. With one tweak; make sure to only do this when on cluster so not all Predis users pay the penalty for it._
    
    Commits
    -------
    
    f5ece20 [Cache] Only delete one key at a time when on Predis + Cluster
Older
You can’t perform that action at this time.