Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add relations defined in RFC 8631 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 633 commits into
base: 6.2
Choose a base branch
Loading
from
Open

Add relations defined in RFC 8631 #1

wants to merge 633 commits into from

Conversation

Oipnet
Copy link
Owner

@Oipnet Oipnet commented Oct 6, 2022

Q A
Branch? 6.2
Bug fix? no
New feature? no
Deprecations? no
Tickets Fix 47716
License MIT

Add link relation constant for RFC 8631

Oipnet pushed a commit that referenced this pull request Jan 9, 2023
…ver with null on non-nullable argument (GromNaN)

This PR was merged into the 6.1 branch.

Discussion
----------

[HttpKernel] Fix deprecation for DateTimeValueResolver with null on non-nullable argument

| Q             | A
| ------------- | ---
| Branch?       | 6.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/pull/48098/files#r1013918566
| License       | MIT
| Doc PR        | n/a

Remove deprecation message when the value is `null` and the controller argument is not nullable.

```
Deprecated: DateTimeImmutable::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated
```

This class have been modified in 6.2. The new test case needs to be updated.

Commits
-------

1d7387b Fix deprecation notice when date argument is not nullable and null value is provided
Oipnet pushed a commit that referenced this pull request Jan 9, 2023
…iously defined date attribute to the expected class (GromNaN)

This PR was merged into the 6.1 branch.

Discussion
----------

[HttpKernel] In DateTimeValueResolver, convert previously defined date attribute to the expected class

| Q             | A
| ------------- | ---
| Branch?       | 6.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/symfony/symfony/pull/48098/files#r1013997729
| License       | MIT

Convert an instance of `DateTimeInterface` to the expected class if the value was predefined in the request attributes.

```php
# in a request listener
$request->attributes->set('date', new \DateTimeImmutable());
```

```php
class MyController
{
    public function index(\DateTime $date)
    {
        // Use the $date
    }
}
```

```
Uncaught TypeError: MyController::index(): Argument #1 ($date) must be of type DateTime, DateTimeImmutable given
```

Commits
-------

22a1567 Convert previously defined date attribute to the expected class
Oipnet pushed a commit that referenced this pull request Jan 9, 2023
…(HypeMC)

This PR was merged into the 6.2 branch.

Discussion
----------

[HttpKernel] Fix `CacheAttributeListener` priority

| Q             | A
| ------------- | ---
| Branch?       | 6.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Currently the `CacheAttributeListener` & the `IsGrantedAttributeListener` have the same priority:

```
Registered Listeners for "kernel.controller_arguments" Event
============================================================

 ------- --------------------------------------------------------------------------------------------------------- ----------
  Order   Callable                                                                                                  Priority
 ------- --------------------------------------------------------------------------------------------------------- ----------
  #1      Symfony\Component\HttpKernel\EventListener\CacheAttributeListener::onKernelControllerArguments()          10
  symfony#2      Symfony\Component\Security\Http\EventListener\IsGrantedAttributeListener::onKernelControllerArguments()   10
  symfony#3      Symfony\Component\HttpKernel\EventListener\ErrorListener::onControllerArguments()                         0
 ------- --------------------------------------------------------------------------------------------------------- ----------
```

Since the `CacheAttributeListener` is alphabetically first, it's first to get triggered. This can cause an unauthenticated user to receive a 304 Not modified instead of a 302 Redirect, resulting in the user seeing some stale content from when they were authenticated instead of getting redirected to the login page.

This PR changes the priority of the `CacheAttributeListener` to be lower than that of the `IsGrantedAttributeListener`.

Commits
-------

90eb89f [HttpKernel] Fix CacheAttributeListener priority
nicolas-grekas and others added 27 commits February 10, 2023 14:06
…eckers)

This PR was merged into the 6.3 branch.

Discussion
----------

[Validator] LuhnValidator code optimization

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Just a minor code optimization. This way it get's a little bit more performance.

Commits
-------

7c99a1f [Validator] LuhnValidator code optimization
This PR was merged into the 6.3 branch.

Discussion
----------

Use xxh128 instead of md5

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | -
| Tickets       | -
| License       | MIT
| Doc PR        | -

`xxh128` is a hash algorithm available in PHP 8.1 that is ~15 times faster than `md5`.

Let's use it where it doesn't change anything functionally to improve the performance.

Commits
-------

d840ec2 Use xxh128 instead of md5
…n array in `TransportNamesStamp` (alexandre-daubois)

This PR was merged into the 6.3 branch.

Discussion
----------

[Messenger] Allow passing a string instead of an array in `TransportNamesStamp`

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | _NA_
| License       | MIT
| Doc PR        | Todo

This PR aims to improve a bit the DX when using `TransportNamesStamp` by allowing passing a string as the only argument of the stamp when only one transport is provided by the developer.

Also, I fixed the property name to match getter's name. I did not changed constructor argument's name as I'm afraid it would be a BC if it is used with named arguments 🤔

Commits
-------

ff86922 [Messenger] Allow passing a string instead of an array in `TransportNamesStamp`
…for MessageInterface implementations (fabpot)

This PR was merged into the 6.3 branch.

Discussion
----------

[Notifier] Introduce FromNotificationInterface for MessageInterface implementations

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        |

Make things more consistent and discoverable.

Commits
-------

2ebb181 [Notifier] Introduce FromNotificationInterface
This PR was squashed before being merged into the 6.3 branch.

Discussion
----------

Smsapi - Make "from" optional

Smsapi.com API have option to send "eco" messages, default with drawn phone number instead of "from" name defined in Smsapi.com User Panel.

So, when from is not set in body of request, in default message is send as "eco". My changes make it possible.

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

8b14052 Smsapi - Make "from" optional
* 6.2:
  Fix merge
  Fix merge
  [FrameworkBundle] Improve error message in MicroKernelTrait when using deprecated configureRoutes(RouteCollectionBuilder) with symfony/routing >= 6.0
  Add warning about Symfony 5.2 changing pcntl_async_signals
  [Tests] Fix static calls and Mock var annotation
  [FrameworkBundle] Fix checkboxes check assertions
  [Notifier][WebProfilerBundle] Ignore messages whose `getNotification` returns `null`
  [HttpClient] Fix over-encoding of URL parts to match browser's behavior
  Fix Psalm job
  Revert "[HttpClient] Add support for "friendsofphp/well-known-implementations""
  [HttpClient] Fix data collector
  [Tests] Migrate tests to static data providers
  [Semaphore] Fix test
  Fix: Split and clean up tests
  Remove unused data provider
  [Form] Check for `RepeatedType` child in `PasswordHasherListener`
  add Sender to the list of bypassed headers
* 6.2:
  fix test
  fix test
  fix tests
This PR was merged into the 6.3 branch.

Discussion
----------

Add many missing PHPdoc return types

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | Ref symfony#47551, continues symfony#49342
| License       | MIT
| Doc PR        | -

This PR adds lots of ``@return`` PHPdoc that we missed in the 5.4 branch. These will produce new deprecation warnings, if applications override one of these methods. It will not break backwards compatibility.
Adding these PHPdoc in 6.3 already allow the community to test all these annotations for 6 months in stable version, before committing to adding them as PHP types in 7.0. This way, I hope we patch out any wrong type.

This PR is done using a slightly modified Psalter script, based on Psalm's type inference. See symfony#49348 for the counter PR adding real PHP types to private, final or internal methods.

Commits
-------

e23d8be Add missing PHPdoc return types
…lopin)

This PR was merged into the 6.3 branch.

Discussion
----------

[HtmlSanitizer] Remove experimental status

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

The HtmlSanitizer component was introduced in May 2022 and the overall API seems stable (I don't anticipate any BC break needed any time soon).

I suggest we remove its experimental status for 6.3. I removed it in the code, I didn't find other places where it could be referenced as experimental but if I forgot some, please let me know :) !

Commits
-------

13114ec [HtmlSanitizer] Remove experimental status
…outerj)

This PR was merged into the 6.3 branch.

Discussion
----------

Add PHP types to private methods and functions

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | Ref symfony#47551, continues symfony#49342
| License       | MIT
| Doc PR        | -

This PR adds real PHP types to private, internal or final (excluding ``@final``) methods based on Psalm's type inference. Many more return types are missing still, but let's do them in other contributions.

This change can result in BC breaks in multiple ways, so we should carefully review the changes:

* A method may wrongly be considered "safe" by Psalter. If the method is unsafe (e.g. ``@final``, but not yet real `final`), we should instead add a PHPdoc return type (see symfony#49349)
* Psalm may not infer the correct set of return types. If an unexpected type is returned, this will result in a PHP error.

Commits
-------

384c9a6 Add PHP types to private methods and functions
* 6.2:
  Fix some phpdoc
  [ErrorHandler] Do not patch return statements in closures
  [DI] keep `proxy` tag on original definition when decorating
This PR was merged into the 6.3 branch.

Discussion
----------

Add void (PHPdoc) return types

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Ref symfony#47551, continues symfony#49342
| License       | MIT
| Doc PR        | -

This introduces lots of void return types to the codebase, following our policy:

* Adding ``@return` void` to any methods that return void is OK
* Adding `void` PHP return type is only OK if the method is internal, private or final (excluding ``@final``).

The changes in this PR are automated through a modified Psalter script. We should particularly review if ``@final`` classes/methods didn't get real PHP void return types, as this is a BC break.

Commits
-------

508ed81 Add void return types
…ault)

This PR was merged into the 6.3 branch.

Discussion
----------

[Filesystem] Remove always true condition

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

`$mode` is type hinted `int $mode`, so this condition is always true.

Commits
-------

d2cf15d [Filesystem] Remove always true condition
* 6.2:
  [Tests] Migrate tests to static data providers
  [Cache] Only validate dbindex parameter when applicable
* 6.2:
  Speed up Psalm tests
  [GHA] Improve workflow titles
  [GHA] Improve workflow titles
  Fix fix
  [Notifier] Fix notifier profiler when transport name is null
  [HttpKernel] Fix setting the session on the main request when it's started by a subrequest
nicolas-grekas and others added 23 commits March 16, 2023 11:04
…d deprecate httplugs use like psr18 client (simonberger)

This PR was squashed before being merged into the 6.3 branch.

Discussion
----------

[FrameworkBundle] Add scoped httplug clients and deprecate httplugs use like psr18 client

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | yes
| Tickets       | Fix symfony#49644
| License       | MIT
| Doc PR        | symfony/symfony-docs#18064

This MR does 2 closely related things to try to fully integrate the HttplugClient with the unique features it brings and on the other hand deprecate its use like a psr18 client which it is in a pending deprecation state since a long time.

- Added a new services `httplug.http_client` and alias `Http\Client\HttpAsyncClient` to inject the the `HttplugClient`.
- Make the available service `Http\Client\HttpClient` a deprecated alias of it
- Create httplug.<scoped_client_id> services for all scoped clients like it is done with the psr18 ClientInterface

Commits
-------

20ab567 [FrameworkBundle] Add scoped httplug clients and deprecate httplugs use like psr18 client
This PR was merged into the 6.3 branch.

Discussion
----------

[Validator] Add PHPDoc void return types

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | contribution to symfony#47551
| License       | MIT
| Doc PR        | -

Add missing void PHPdoc return types for the Validator component

Commits
-------

e70241d [Validator] Add PHPDoc void return types
…olas-grekas)

This PR was merged into the 6.3 branch.

Discussion
----------

[Config] Improve performance of GlobResource

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix symfony#49668
| License       | MIT
| Doc PR        | -

When using an extended glob pattern that contains `/**/`, we skip using the native `glob()` function and we fallback to using the Finder component.

For a pattern like `./{apps,src}/**/*Controller.php`, the way finder works in `GlobResource` is that we list all files *recursively* in the directory before the pattern starts (`./` here) and we filter the paths using a regexp.

This PR ensures that we scan only the `apps` and `src` directories when presented with such a pattern.

Commits
-------

1771262 [Config] Improve performance of GlobResource
This PR was merged into the 6.3 branch.

Discussion
----------

[ErrorHandler] Fixed tests

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

bb8b73e [ErrorHandler] Fixed tests
…bpot)

This PR was merged into the 6.3 branch.

Discussion
----------

[Messenger] Add a scheduler component

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | no
| License       | MIT
| Doc PR        | TBD

### Introdution

There is no easy way to schedule periodical tasks. There are few useful tools which I touched:

- https://github.com/Guikingone/SchedulerBundle
- https://github.com/Cron/Symfony-Bundle
- https://github.com/zenstruck/schedule-bundle
- https://github.com/lavary/crunz

They are complicated. They doesn't allow to set time with precision in seconds (at least it isn't easy). They require difficult tricks to set not linear periods (like on sunset in Tokyo). ~They are~ Part of them inefficient with infrequent tasks because resources are needed on every run (e.g. Kubernetes [CronJob](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/) creates and destroes an entire container).

### Proposal

I use a custom transport of Messenger that **generates** messages periodically. It's a simple solution to run periodical jobs without external software. It's especially helpful in environments where additional runners are impossible or very painful (like Kubernetes). Configuration is very flexible and accurate, it's possible to configure any rules when to run or not to run.

Compared to `crond`: there is no need to install something external, precision of schedule in microseconds instead of *minutes*, it's possible to set any periods.

#### Simple example

```yaml
# messenger.yaml
framework:
  messenger:
    transports:
      schedule_default: 'schedule://default'
```

Few types of messages:
```php
class SomeJob {}
class OtherJob {}
```

A handlers:
```php
#[AsMessageHandler]
class SomeJobHandler {
    public function __invoke(SomeJob $job) {
        // do job or delegate it to other service
    }
}

#[AsMessageHandler]
class OtherJobHandler {
    public function __invoke(OtherJob $job) {
        // do job or delegate it to other service
    }
}
```

A schedules are provided by locators. It's possible to create many locators and/or provide many schedules by the same locator:

```php
class ExampleLocator implements ScheduleLocatorInterface
{
    public function get(string $id): ScheduleConfig
    {
        // once after an hour from now
        $deferForAnHour = new \DatePeriod(
            new \DateTimeImmutable('now'),
            new \DateInterval('PT1H'),
            1,
            \DatePeriod::EXCLUDE_START_DATE
        );

        return (new ScheduleConfig())
            ->add(new OnceTrigger(new \DateTimeImmutable()), new WarmUpJob()) // once on every worker's start
            ->add(PeriodicalTrigger::create('P1D', '2022-01-01T03:00:00Z'), new SomeJob()) // every night at 3 a.m. (UTC)
            ->add(PeriodicalTrigger::fromPeriod($deferForAnHour), new OtherJob())
        ;
    }

    public function has(string $id): bool
    {
        return 'default' === $id;
    }
}
```

To run schedule:

```sh
bin/console messenger:consume schedule_default
```

It's easy to run jobs manually:

```php
#[AsCommand(name: 'some', description: 'Manually runs SomeJob')]
class SomeCommand extends Command {
    public function __construct(private MessageBusInterface $bus) {
    }

    protected function execute(InputInterface $input, OutputInterface $output): int {
        $this->bus->dispatch(new SomeJob());
    }
}
```

#### Example with returning a result

```php
class GoodJob {
    public function __construct(public readonly ?LoggerInterface $logger) {
    }
}
```

```php
#[AsMessageHandler]
class GoodHandler {
    public function __construct(private readonly LoggerInterface $logger) {
    }

    public function __invoke(GoodJob $job){
        // compute $result
        ($job->logger ?? $this->logger)->info('The result is: {result}', ['result' => $result])
    }
}
```

```php
#[AsCommand(name: 'job', description: 'Manually runs job')]
class SomeCommand extends Command {
    public function __construct(private MessageBusInterface $bus) {
    }

    protected function execute(InputInterface $input, OutputInterface $output): int {
        $this->bus->dispatch(new GoodJob(new ConsoleLogger($output))); // result will be printed in console
    }
}
```

#### Configuring

A minimal configuration:

```yaml
# messenger.yaml
framework:
  messenger:
    transports:
      schedule_default: 'schedule://default'
```

More complex example:

```yaml
# messenger.yaml
framework:
  messenger:
    transports:
      schedule_default:
        dsn: 'schedule://default'
        options:
          cache: 'app.cache'
          lock: 'default'
```

Example HA configuration with redis:

```yaml
framework:
  cache:
    default_redis_provider: '%env(REDIS_DSN)%'
  lock:
    redis: '%env(REDIS_DSN)%'
  messenger:
    transports:
      schedule_default:
        dsn: 'schedule://default'
        options:
          cache: 'cache.redis'
          lock:
            resource: 'redis'
            ttl: 60
            auto_release: true
```

### Deprecations

None

### Implementation

This PR contains an implementation.

### ToDo

- [x] Remove obsolete code
- [x] Add a configuration to the Framework
- [x] Specialize exceptions and improve messages
- [x] Cover with tests
- [ ] Add acceptance tests for HA
- [x] Fix `CHANGELOG`s & `README`s
- [ ] Add documentation

Commits
-------

a18127b [Scheduler] Rework the component
6d9311f Add the Scheduler component
* 6.2:
  explicitly set the HTTP method override option to false
…MessengerPass (onEXHovia)

This PR was merged into the 6.3 branch.

Discussion
----------

[Scheduler] Remove unused variable in AddScheduleMessengerPass

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

09df772 [Scheduler] Remove unused variable in AddScheduleMessengerPass
…shover bridge (vlepeule)

This PR was squashed before being merged into the 6.3 branch.

Discussion
----------

[Notifier] Add "retry" and "expire" options to Pushover bridge

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Add "retry" and "expire" options to handle "Emergency Priority", according to  [Pushover API documentation](https://pushover.net/api#priority) :

> To send an emergency-priority notification, the priority parameter must be set to 2 and the retry and expire parameters must be supplied.

Commits
-------

2feabc6 [Notifier] Add "retry" and "expire" options to Pushover bridge
This PR was merged into the 6.3 branch.

Discussion
----------

[Scheduler] Fix some minor bugs

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

9fc7cf5 [Scheduler] Fix some minor bugs
…rializer.html.twig (k0d3r1s)

This PR was merged into the 6.3 branch.

Discussion
----------

[WebProfilerBundle] replace helper with _self in serializer.html.twig

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix symfony#49686
| License       | MIT

While waiting for reply, here is a fix for bug in symfony#49686.
As`helper` was removed, now `_self` must be used, these looks like forgotten places

Commits
-------

b27aab9 [WebProfilerBundle] replace helper with _self in serializer.html.twig
…nMemoryTransport (fabpot)

This PR was merged into the 6.3 branch.

Discussion
----------

[Messenger] Add support for the DelayStamp in InMemoryTransport

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

1025f35 [Messenger] Add support for the DelayStamp in InMemoryTransport
…en the component is used standalone (fabpot)

This PR was merged into the 6.3 branch.

Discussion
----------

[Scheduler] Add a simple Scheduler class for when the component is used standalone

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | -

```
$handler = new SomeHandler();
$scheduler = new Scheduler([SomeJob::class => new SomeHandler()], [$someProvider->getSchedule(), $anotherSchedule]);
$scheduler->run();
```

Commits
-------

0f5422c [Scheduler] Add a simple Scheduler class for when the component is used standalone
… component (fabpot)

This PR was squashed before being merged into the 6.3 branch.

Discussion
----------

[FrameworkBundle] Fix registration of the Scheduler component

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

251ed12 [Scheduler] Fix usage without a Lock
313644f [FrameworkBundle] Fix registration of the Scheduler component
nicolas-grekas added a commit that referenced this pull request Mar 19, 2023
…ixed attributes (delbertooo)

This PR was submitted for the 6.2 branch but it was merged into the 5.4 branch instead.

Discussion
----------

[FrameworkBundle] Fix denyAccessUnlessGranted for mixed attributes

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? |no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Checking authorization against anything that isn't `array|string` will cause PHP errors now. The method `AbstractController::denyAccessUnlessGranted()` sets the given *single* attribute into the exception in case of denied access. The `AuthorizationCheckerInterface` defines that the attribute can be anything, even objects. The parameter type hint `array|string` of `AccessDeniedException::setAttributes()` want's an array of attributes (or a string for convenience).

# Example

```php
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

class MyCustomAttribute
{
}

class ProfileController extends AbstractController
{
    public function index(): Response
    {
        $this->denyAccessUnlessGranted(new MyCustomAttribute()); // 💥 ERROR: Symfony\Component\Security\Core\Exception\AccessDeniedException::setAttributes(): Argument #1 ($attributes) must be of type array|string, [...]

        $user = $this->getUser();

        return new Response('Well hi there '.$user->getFirstName());
    }
}
```

# The fix

As the given attribute is a *single* attribute: always wrap it into an array when creating the exception, because the exception expects an array of attributes.

Commits
-------

9ed77f3 [FrameworkBundle] Fix denyAccessUnlessGranted for mixed attributes
Oipnet pushed a commit that referenced this pull request Sep 8, 2023
…ring, bool given (danepowell)

This PR was merged into the 5.4 branch.

Discussion
----------

[Console] trim(): Argument #1 () must be of type string, bool given

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  |no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? |no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix.
This will help reviewers and should be a good start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - Bug fixes must be submitted against the lowest maintained 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 latest branch.
 - For new features, provide some code snippets to help understand usage.
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
 - Never break backward compatibility (see https://symfony.com/bc).
-->

If you run a Symfony Console application in Git Bash, ANSICON is not set out of the box and results in this (suppressed) error:
> trim(): Argument ($string) must be of type string, bool given

AFAICT, this method is only called from Application::run() and errors are suppressed. So users will never actually see that error. Still, it could have side effects and breaks downstream projects: box-project/box#990

Commits
-------

324b160 trim(): Argument #1 () must be of type string, bool given
Oipnet pushed a commit that referenced this pull request Sep 8, 2023
* 5.4:
  trim(): Argument #1 () must be of type string, bool given
  [Dumper] Trim leading newlines when checking if value begins with a space
  Fix the list of supported shells for completions in a phar
Oipnet pushed a commit that referenced this pull request Sep 8, 2023
* 6.2:
  Fix test class name
  trim(): Argument #1 () must be of type string, bool given
  Check if trace.curlCommand is defined in profiler
  [Dumper] Trim leading newlines when checking if value begins with a space
  [FrameworkBundle] Make service edges unique
  Fix the list of supported shells for completions in a phar
  Fix the usage of the zsh completion through the fpath discovery
Oipnet pushed a commit that referenced this pull request Sep 8, 2023
…he monorepo (fabpot, dunglas, KorvinSzanto, xabbuh, aimeos, ahundiak, Danielss89, rougin, csunolgomez, Jérôme Parmentier, mtibben, Nyholm, ajgarlag, uphlewis, samnela, grachevko, nicolas-grekas, tinyroy, danizord, Daniel Degasperi, rbaarsma, Ekman, 4rthem, derrabus, mleczakm, iluuu1994, Tobion, chalasr, lemon-juice, franmomu, cidosx, erikn69, AurelienPillevesse)

This PR was merged into the 6.4 branch.

Discussion
----------

[PsrHttpMessageBridge] Import the bridge into the monorepo

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | TODO

⚠️ Don't squash!

I propose to import the `symfony/psr-http-message-bridge` package into the Symfony monorepo for further maintenance.

Commits
-------

e40dd66 [PsrHttpMessageBridge] Patch return types and fix CS
266c09f [PsrHttpMessageBridge] Import the bridge into the monorepo
0c0323a Add 'src/Symfony/Bridge/PsrHttpMessage/' from commit '581ca6067eb62640de5ff08ee1ba6850a0ee472e'
581ca60 Prepare release 2.3.1
45d0349 Fix CS
6410dda bug symfony#122 Don't rely on Request::getPayload() to populate the parsed body (nicolas-grekas)
ef03b6d Don't rely on Request::getPayload() to populate the parsed body
3c62b81 minor symfony#120 Prepare release 2.3.0 (derrabus)
96acbfd Prepare release 2.3.0
7eedd34 feature symfony#119 Implement ValueResolverInterface (derrabus)
0b54b85 Implement ValueResolverInterface
6b2f5df feature symfony#117 Leverage `Request::getPayload()` to populate the parsed body of PSR-7 requests (AurelienPillevesse)
3a8caad Leverage `Request::getPayload()` to populate the parsed body of PSR-7 requests
18c9e82 minor symfony#118 Add native types where possible (derrabus)
4fd4323 Add native types where possible
28a732c minor symfony#115 Prepare the 2.2.0 release (derrabus)
7944831 cs fix
99ddcaa Prepare the 2.2.0 release
8a5748d feature symfony#113 Bump psr/http-message version (erikn69)
ec83c1c Bump psr/http-message version
694016e feature symfony#114 Drop support for Symfony 4 (derrabus)
b360b35 Drop support for Symfony 4
998d8d2 minor symfony#111 Adjustments for PHP CS Fixer 3 (derrabus)
5fa5f62 Adjustments for PHP CS Fixer 3
a125b93 minor symfony#110 Add PHP 8.2 to CI (derrabus)
4592df2 Add PHP 8.2 to CI
4617ac3 bug symfony#109 perf: ensure timely flush stream buffers (cidosx)
8c8a75b perf: ensure timely flush stream buffers
d444f85 Update changelog
155a7ae bug symfony#107 Ignore invalid HTTP headers when creating PSR7 objects (nicolas-grekas)
9a78a16 Ignore invalid HTTP headers when creating PSR7 objects
bdb2871 minor symfony#104 Add missing .gitattributes (franmomu)
808561a Add missing .gitattributes
316f5cb bug symfony#103 Fix for wrong type passed to moveTo() (lemon-juice)
7f3b5c1 Fix for wrong type passed to moveTo()
22b37c8 minor symfony#101 Release v2.1.2 (chalasr)
c382d76 Release v2.1.2
c81476c feature symfony#100 Allow Symfony 6 (chalasr)
c7a0be3 Allow Symfony 6
df83a38 minor symfony#98 Add PHP 8.1 to CI (derrabus)
b2bd334 Add PHP 8.1 to CI
824711c minor symfony#99 Add return types to fixtures (derrabus)
f8f70fa Add return types to fixtures
d558dcd minor symfony#97 Inline $tmpDir (derrabus)
d152649 Inline $tmpDir
f12a9e6 minor symfony#96 Run PHPUnit on GitHub Actions (derrabus)
ab64c69 Run PHPUnit on GitHub Actions
c901299 bug symfony#95 Allow `psr/log` 2 and 3 (derrabus)
8e13ae4 Allow psr/log 2 and 3
26068fa Minor cleanups
87fabb9 Fix copyright year
3d9241f minor symfony#92 remove link to sensio extra bundle which removed psr7 support (Tobion)
7078739 remove link to sensio extra bundle which removed psr7 support
81db2d4 feature symfony#89 PSR HTTP message converters for controllers (derrabus)
aa26e61 PSR HTTP message converters for controllers
e62b239 minor symfony#91 Fix CS (derrabus)
2bead22 Fix CS
488df9b minor symfony#90 Fix CI failures with Xdebug 3 and test on PHP 7.4/8.0 as well (derrabus)
a6697fd Fix CI failures with Xdebug 3 and test on PHP 7.4/8.0 as well
c62f7d0 Update branch-alias
51a21cb Update changelog
a20fff9 bug symfony#87 Fix populating server params from URI in HttpFoundationFactory (nicolas-grekas)
4933e04 bug symfony#86 Create cookies as raw in HttpFoundationFactory (nicolas-grekas)
66095a5 Fix populating server params from URI in HttpFoundationFactory
42cca49 Create cookies as raw in HttpFoundationFactory
cffb3a8 bug symfony#85 Fix BinaryFileResponse with range to psr response conversion (iluuu1994)
5d5932d Fix BinaryFileResponse with range to psr response conversion
e44f249 bug symfony#81 Don't normalize query string in PsrHttpFactory (nicolas-grekas)
bc25829 Don't normalize query string in PsrHttpFactory
df735ec bug symfony#78 Fix populating default port and headers in HttpFoundationFactory (mleczakm)
4f30401 Fix populating default port and headers in HttpFoundationFactory
1309b64 bug symfony#77 fix conversion for https requests (4rthem)
e86de3f minor symfony#79 Allow installation on php 8 (derrabus)
9243f93 Allow installation on php 8.
d336c73 fix conversion for https requests
126903c Fix format of CHANGELOG.md
ce709cd feature symfony#75 Remove deprecated code (fabpot)
dfc5238 Remove deprecated code
9d3e80d bug symfony#72 Use adapter for UploadedFile objects (nicolas-grekas)
a4f9f6d Use adapter for UploadedFile objects
ec7892b Fix CHANGELOG, bump branch-alias
7ab4fe4 minor symfony#70 Updated CHANGELOG (rbaarsma)
9ad4bcc Updated CHANGELOG
c4c904a minor symfony#71 Cleanup after bump to Symfony v4.4 (nicolas-grekas)
e9a9557 Cleanup after bump to Symfony v4.4
3d10a6c feature symfony#66 Add support for streamed Symfony request (Ekman)
df26630 Add support for streamed Symfony request
5aa8ca9 bug symfony#69 Allow Symfony 5.0 (rbaarsma)
1158149 Allow Symfony 5.0
81ae86d Merge branch '1.1'
a33352a bug symfony#64 Fixed createResponse (ddegasperi)
7a4b449 minor symfony#65 Fix tests (ajgarlag)
19905b0 Fix tests
580de38 Fixed createResponse
9ab9d71 minor symfony#63 Added links to documentation (Nyholm)
59b9406 Added links to documentation
c1cb51c feature symfony#50 Add support for streamed response (danizord)
4133c7a bug symfony#48 Convert Request/Response multiple times (Nyholm)
8564bf7 Convert Request/Response multiple times
7cc1605 Add support for streamed response
aebc14b feature symfony#62 bump to PHP 7.1 (nicolas-grekas)
8e10923 bump to PHP 7.1
5e5e0c3 Revert "Undeprecate DiactorosFactory for 1.1"
921f866 Undeprecate DiactorosFactory for 1.1
8592ca3 bug symfony#61 removed 'Set-Cookie' from header when it is already converted to a Symfony header cookie (tinyroy)
dd1111e removed 'Set-Cookie' from header when it is already converted to a Symfony header cookie
ba672d8 bump branch-alias
5f9a032 typo
f2c48c5 fix tests
3a52e44 bug symfony#59 Fix SameSite attribute conversion from PSR7 to HttpFoundation (ajgarlag)
5ee1f8f Fix SameSite attribute conversion from PSR7 to HttpFoundation
f6d7d3a bug symfony#58 [Bugfix] Typo header set-sookie (grachevko)
16eb6e1 minor symfony#57 Excluded tests from classmap (samnela)
36a8065 Deprecate DiactorosFactory, use nyholm/psr7 for tests
5076934 bug symfony#54 Fix symfony#51 (compatability issue with zendframework/zend-diactoros ^2.0) (uphlewis)
757ea81 [Bugfix] Typo header set-sookie
25f9c3a Excluded tests from classmap
8ff61e5 Fix compatability issue with "zendframework/zend-diactoros": "^2.0." (symfony#51)
53c15a6 updated CHANGELOG
c821241 bumped version to 1.1
f26d01f minor symfony#47 Updated changelog (Nyholm)
c2282e3 Updated changelog
eddd6c8 feature symfony#43 Create PSR-7 messages using PSR-17 factories (ajgarlag)
dd81b4b Create PSR-7 messages using PSR-17 factories
f11f173 feature symfony#45 Fixed broken build (Nyholm)
8780dd3 Fixed broken build
c2b7579 bug symfony#30 Fix the request target in PSR7 Request (mtibben)
94fcfa5 Fix the request target in PSR7 Request
64640ee minor symfony#38 Run PHP 5.3 tests on Precise (Lctrs)
64c0cb0 Run PHP 5.3 tests on Precise
b209840 minor symfony#32 Allow Symfony 4 (dunglas)
97635f1 Allow Symfony 4
147a238 minor symfony#31 test suite compatibility with PHPUnit 6 (xabbuh)
f5c46f0 test suite compatibility with PHPUnit 6
66085f2 preparing 1.0 release
533d3e4 added a CHANGELOG for 1.0
14269f9 bug symfony#28 Fix REQUEST_METHOD on symfony request (csunol)
98ab85a Fix REQUEST_METHOD on symfony request
29be4f8 updated LICENCE year
d2db47c removed obsolete CHANGELOG file
1c30b17 bug symfony#22 Fixes symfony#16 Symfony Request created without any URI (rougin)
a59c572 Fixes symfony#16 Symfony Request created without any URI
7a5aa92 bug symfony#23 Fixes symfony#9 Bridge error when no file is selected (ahundiak, Danielss89)
a1a631a Update assert error message
e5d62e6 Fixes based on code-review
101b608 Handles null file in createrequest bridge.
d16c63c bug symfony#18 Allow multiple calls to Request::getContent() (aimeos)
9624b8b Allow multiple calls to Request::getContent()
9c747c4 Merge pull request symfony#19 from xabbuh/travis-config
a388c43 update Travis CI configuration
ac5cd86 minor symfony#14 Remove use of deprecated 'deep' parameter in tests (KorvinSzanto)
305c0fe Remove use of deprecated 'deep' parameter
3664dc0 minor symfony#7 Test Diactoros Factory with PHP 5.4 (dunglas)
bab1530 Test Diactoros Factory with PHP 5.4
d7660b8 Suggest psr/http-message-implementation
dc7e308 removed the branch alias for now as we are pre 1.0
3f8977e feature #1 Initial support (dunglas)
ca41146 Initial support
01b110b added the initial set of files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.