Skip to content
Permalink
6.2
Switch branches/tags

Commits on Aug 19, 2022

  1. Merge branch '6.1' into 6.2

    * 6.1:
      [Security][AbstractToken] getUserIdentifier() must return a string
      [HttpFoundation] Prevent accepted rate limits with no remaining token to be preferred over denied ones
      Email image parts: regex for single closing quote
      [Serializer] Throw InvalidArgumentException if the data needed in the constructor doesn't belong to a backedEnum
    xabbuh committed Aug 19, 2022
  2. Merge branch '6.0' into 6.1

    * 6.0:
      [Security][AbstractToken] getUserIdentifier() must return a string
      [HttpFoundation] Prevent accepted rate limits with no remaining token to be preferred over denied ones
      Email image parts: regex for single closing quote
      [Serializer] Throw InvalidArgumentException if the data needed in the constructor doesn't belong to a backedEnum
    xabbuh committed Aug 19, 2022
  3. Merge branch '5.4' into 6.0

    * 5.4:
      [HttpFoundation] Prevent accepted rate limits with no remaining token to be preferred over denied ones
      Email image parts: regex for single closing quote
      [Serializer] Throw InvalidArgumentException if the data needed in the constructor doesn't belong to a backedEnum
    xabbuh committed Aug 19, 2022
  4. Merge branch '4.4' into 5.4

    * 4.4:
      Email image parts: regex for single closing quote
    xabbuh committed Aug 19, 2022
  5. minor #47337 [Clock] relax some assertions to transient NativeClock t…

    …ests (xabbuh)
    
    This PR was merged into the 6.2 branch.
    
    Discussion
    ----------
    
    [Clock] relax some assertions to transient NativeClock tests
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.2
    | Bug fix?      | no
    | New feature?  | no
    | Deprecations? | no
    | Tickets       |
    | License       | MIT
    | Doc PR        |
    
    Commits
    -------
    
    2e2c3e7 relax some assertions to transient NativeClock tests
    xabbuh committed Aug 19, 2022
  6. feature #47101 [DependencyInjection] Allow service subscribers to ret…

    …urn `SubscribedService[]` (kbond)
    
    This PR was squashed before being merged into the 6.2 branch.
    
    Discussion
    ----------
    
    [DependencyInjection] Allow service subscribers to return `SubscribedService[]`
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.2
    | Bug fix?      | no
    | New feature?  | yes
    | Deprecations? | no
    | Tickets       | n/a
    | License       | MIT
    | Doc PR        | todo
    
    This allows `ServiceSubscriberInterface::getSubscribedServices()` to return `SubscribedService[]` which now has the ability to add DI attribute objects (ie `Target`).
    
    ```php
    public static function getSubscribedServices(): array
    {
        return [
            new SubscribedService('logger', Psr\Log\LoggerInterface::class),
            new SubscribedService(type: Psr\Log\LoggerInterface::class, nullable: true),
            new SubscribedService('http_client', HttpClientInterface::class, attributes: new Target('githubApi'))),
        ];
    }
    ```
    
    When using the `ServiceSubscriberTrait`, the `SubscribedService` attribute can add attributes as well:
    
    ```php
    #[SubscribedService(attributes: new Target('githubApi'))]
    private function httpClient(): ?HttpClientInterface
    {
        return $this->container->get(__METHOD__);
    }
    ```
    
    TODO:
    - [x] Implementation
    - [x] Tests
    - [x] Changelog
    
    Commits
    -------
    
    049f15e [DependencyInjection] Allow service subscribers to return `SubscribedService[]`
    fabpot committed Aug 19, 2022
  7. bug #47329 Email image parts: regex for single closing quote (rr-it)

    This PR was merged into the 4.4 branch.
    
    Discussion
    ----------
    
    Email image parts: regex for single closing quote
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 4.4
    | Bug fix?      | yes
    | New feature?  | no
    | Deprecations? | no
    | Tickets       | -
    | License       | MIT
    | Doc PR        | -
    
    The regex for image src matches for single and double opening quotes:
    `([\'"])`
    
    The corresponding matching for non-closing characters is implemented for double quotes only:
    `([^"]+)`
    
    This change adds a non-greedy regex `.+?` which matches for as few characters as possbile before the "correspondingly matched opening quote" `\\1` appears.
    
    Commits
    -------
    
    57c49b4 Email image parts: regex for single closing quote
    fabpot committed Aug 19, 2022
  8. bug #47335 [Security] [AbstractToken] getUserIdentifier() must return…

    … a string (mpiot)
    
    This PR was submitted for the 6.2 branch but it was merged into the 6.0 branch instead.
    
    Discussion
    ----------
    
    [Security] [AbstractToken] getUserIdentifier() must return a string
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.1
    | Bug fix?      | yes
    | New feature?  | no
    | Deprecations? | no
    | Tickets       |
    | License       | MIT
    | Doc PR        |
    
    Fix the `getUserIdentifier()` method from Symfony\Component\Security\Core\Authentication\Token\AbstractToken, he method must return a string, but based on a nullable UserInterface object.
    
    Commits
    -------
    
    2987d58 [Security][AbstractToken] getUserIdentifier() must return a string
    fabpot committed Aug 19, 2022
  9. minor #47336 [FrameworkBundle] clean up unused variables (xabbuh)

    This PR was merged into the 6.2 branch.
    
    Discussion
    ----------
    
    [FrameworkBundle] clean up unused variables
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.2
    | Bug fix?      | no
    | New feature?  | no
    | Deprecations? | no
    | Tickets       |
    | License       | MIT
    | Doc PR        |
    
    spotted while reviewing #46000
    
    Commits
    -------
    
    ccfb1e5 clean up unused variables
    fabpot committed Aug 19, 2022
  10. feature #40152 [Messenger] Pass sender details to SendMessageToTransp…

    …ortsEvent (Jeroeny)
    
    This PR was merged into the 6.2 branch.
    
    Discussion
    ----------
    
    [Messenger] Pass sender details to SendMessageToTransportsEvent
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.1
    | Bug fix?      | no
    | New feature?  | yes
    | Deprecations? | no
    | License       | MIT
    
    This is a feature suggestion that will allow listeners for `SendMessageToTransportsEvent` to be able to read the sender and sender alias from a sent message.
    
    Use case: To create metrics for messages that go through the system (and especially where to and from). Listener(s) can be created to measure this. They would listen to `WorkerMessageHandledEvent`, `WorkerMessageFailedEvent` and `SendMessageToTransportsEvent`. The first two receive envelopes that contain a `ReceivedStamp`, to determine where the message came from. However, the received envelopes for sent messages do not contain a stamp to read the sender. It would be great if this was possible to do with listener (instead of having to add middleware to each bus).
    
    Approach in this PR: stamp the envelope with `SentStamp` before dispatching `SendMessageToTransportsEvent`.
    
    Alternative approach: pass the info to the event directly: `new SendMessageToTransportsEvent($envelope, get_class($sender), $alias)`.  And keep the stamping afterwards.
    
    **Edit**: I just noticed that one event is dispatched regardless of the number of senders. In that case the event could be dispatched after all the senders have been called (and thus all the stamps set).
    
    Commits
    -------
    
    92b512a add senders to SendMessageToTransportsEvent
    fabpot committed Aug 19, 2022
  11. clean up unused variables

    xabbuh committed Aug 19, 2022
  12. feature #41171 [Messenger] Add simple transport based rate limiter to…

    … Messenger (bobvandevijver)
    
    This PR was squashed before being merged into the 6.2 branch.
    
    Discussion
    ----------
    
    [Messenger] Add simple transport based rate limiter to Messenger
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.1
    | Bug fix?      | no
    | New feature?  | yes
    | Deprecations? | no
    | Tickets       | Fix #36808
    | License       | MIT
    | Doc PR        | -
    
    This PR adds the possibility to add a simple, transport based, rate limiter (as defined with the RateLimiter component) to the Messenger worker.
    
    Commits
    -------
    
    29a2585 [Messenger] Add simple transport based rate limiter to Messenger
    fabpot committed Aug 19, 2022
  13. bug #47283 [HttpFoundation] Prevent accepted rate limits with no rema…

    …ining token to be preferred over denied ones (MatTheCat)
    
    This PR was squashed before being merged into the 5.4 branch.
    
    Discussion
    ----------
    
    [HttpFoundation] Prevent accepted rate limits with no remaining token to be preferred over denied ones
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 5.4
    | Bug fix?      | yes
    | New feature?  | no
    | Deprecations? | no
    | Tickets       | Fix #47282
    | License       | MIT
    | Doc PR        | N/A
    
    When a rate limit is first accepted with no remaining token, following rejected rate limits will be ignored because they also will have no remaining token. The request would then be processed.
    
    Commits
    -------
    
    8188f1c [HttpFoundation] Prevent accepted rate limits with no remaining token to be preferred over denied ones
    fabpot committed Aug 19, 2022
  14. [HttpFoundation] Prevent accepted rate limits with no remaining token…

    … to be preferred over denied ones
    MatTheCat authored and fabpot committed Aug 19, 2022
  15. bug #47128 [Serializer] Throw InvalidArgumentException if the data ne…

    …eded in the constructor doesn't belong to a backedEnum (allison guilhem)
    
    This PR was merged into the 5.4 branch.
    
    Discussion
    ----------
    
    [Serializer] Throw InvalidArgumentException if the data needed in the constructor doesn't belong to a backedEnum
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 5.4
    | Bug fix?      | yes
    | New feature?  | no
    | Deprecations? |no
    | Tickets       | Fix #46977 [Serializer] Collect deserialization errors on enum cause TypeError
    | License       | MIT
    | Doc PR        |
    
    Targeted case: Deserialization with "collect_denormalization_errors" set but the data to be serialized does not correspond to the scalar value of the targeted enum instance in the object's constructor.
    updated in last commit : Keep "from "(in the previous commits I had switched to "tryFrom") to map the data submitted to an enum instance targeted.
    
    Imho, even if the "collect_denormalization_errors" is specified, this type of error seems to have to be caught upstream. By just trying to collect the error we do not prevent the object from being instantiated. But this action is bound to fail because we already know that the data is not valid (checked by the BackedEnumNormalizer). This instantiation 'failure' leads to a confusing/misleading error (i.e. _Argument # 1 ($test) must be of type TestEnum, string given_) which is not the original error.
    
    Commits
    -------
    
    c30f057 [Serializer] Throw InvalidArgumentException if the data needed in the constructor doesn't belong to a backedEnum
    fabpot committed Aug 19, 2022
  16. minor #47328 [Clock] use the clock mock to fix transient MonotonicClo…

    …ck tests (xabbuh)
    
    This PR was merged into the 6.2 branch.
    
    Discussion
    ----------
    
    [Clock] use the clock mock to fix transient MonotonicClock tests
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.2
    | Bug fix?      | no
    | New feature?  | no
    | Deprecations? | no
    | Tickets       |
    | License       | MIT
    | Doc PR        |
    
    Commits
    -------
    
    b714b04 use the clock mock to fix transient MonotonicClock tests
    nicolas-grekas committed Aug 19, 2022

Commits on Aug 18, 2022

  1. Email image parts: regex for single closing quote

    The regex for image src matches for single and double opening quotes:
    `([\'"])`
    
    The corresponding matching for non-closing characters is implemented for double quotes only:
    ([^"]+)
    
    This change adds a non-greedy regex `.+?` which matches for as few characters as possbile before the "correspondingly matched opening quote" `\\1` appears.
    rr-it committed Aug 18, 2022
  2. bug #47318 [PhpUnitBridge] fix order of returned array values for moc…

    …ked hrtime() (xabbuh)
    
    This PR was merged into the 6.2 branch.
    
    Discussion
    ----------
    
    [PhpUnitBridge] fix order of returned array values for mocked hrtime()
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.2
    | Bug fix?      | yes
    | New feature?  | no
    | Deprecations? | no
    | Tickets       |
    | License       | MIT
    | Doc PR        |
    
    Commits
    -------
    
    a2af29b fix order of returned array values for mocked hrtime()
    xabbuh committed Aug 18, 2022
  3. minor #47319 revert #47270 to not use microtime() in the NativeClock …

    …(xabbuh)
    
    This PR was merged into the 6.2 branch.
    
    Discussion
    ----------
    
    revert #47270 to not use microtime() in the NativeClock
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.2
    | Bug fix?      | no
    | New feature?  | no
    | Deprecations? | no
    | Tickets       |
    | License       | MIT
    | Doc PR        |
    
    Commits
    -------
    
    21f4055 Revert "minor #47270 [Clock] fix transient NativeClock test (xabbuh)"
    xabbuh committed Aug 18, 2022
  4. [Serializer] Throw InvalidArgumentException if the data needed in the…

    … constructor doesn't belong to a backedEnum
    allison guilhem authored and alli83 committed Aug 18, 2022
  5. bug #47242 [DoctrineBridge] Do not ignore null IDs in EntityValueReso…

    …lver (MatTheCat)
    
    This PR was squashed before being merged into the 6.2 branch.
    
    Discussion
    ----------
    
    [DoctrineBridge] Do not ignore null IDs in EntityValueResolver
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.2
    | Bug fix?      | yes
    | New feature?  | no
    | Deprecations? | no
    | Tickets       | Fix #47166
    | License       | MIT
    | Doc PR        | N/A
    
    The `EntityValueResolver` first try to fetch an entity by its ID but handle null and non-existent IDs the same.
    
    If a `null` ID is present, it feels weird to ignore it and try matching an entity using other request attributes. Better return `null` in this case.
    
    Commits
    -------
    
    db05d4c [DoctrineBridge] Do not ignore null IDs in EntityValueResolver
    nicolas-grekas committed Aug 18, 2022
  6. Revert "minor #47270 [Clock] fix transient NativeClock test (xabbuh)"

    This reverts commit fc868f4, reversing
    changes made to 2e87d30.
    xabbuh committed Aug 18, 2022

Commits on Aug 17, 2022

  1. Merge branch '6.1' into 6.2

    * 6.1:
      [HttpFoundation] Fix tests on PHP 8.2 (bis)
    nicolas-grekas committed Aug 17, 2022
  2. Merge branch '6.0' into 6.1

    * 6.0:
      [HttpFoundation] Fix tests on PHP 8.2 (bis)
    nicolas-grekas committed Aug 17, 2022
  3. Merge branch '5.4' into 6.0

    * 5.4:
      [HttpFoundation] Fix tests on PHP 8.2 (bis)
    nicolas-grekas committed Aug 17, 2022
  4. Merge branch '4.4' into 5.4

    * 4.4:
      [HttpFoundation] Fix tests on PHP 8.2 (bis)
    nicolas-grekas committed Aug 17, 2022
  5. Merge branch '6.1' into 6.2

    * 6.1:
      Fix merge
    nicolas-grekas committed Aug 17, 2022
Older