profile
viewpoint
Fabien Potencier fabpot Symfony/Blackfire Lille, France http://fabien.potencier.org/

doctrine/DoctrineBundle 3604

Symfony Bundle for Doctrine ORM and DBAL

fabpot/Pimple 75

A small PHP 5.3 dependency injection container

fabpot/composer 43

Package Manager for PHP

fabpot/PHP-CS-Fixer 43

A tool to automatically fix PHP coding standards issues

fabpot/EasyAdminBundle 11

The new (and simple) admin generator for Symfony applications.

fabpot/api-platform 6

Build hypermedia and GraphQL APIs in minutes, generate Progressive Web Apps to consume them.

fabpot/api-pack 5

A pack for API Platform

fabpot/carsonbot 4

Issue Bot used on symfony/symfony

fabpot/doctrine2 4

Doctrine 2 Object Relational Mapper (ORM)

Pull request review commentsymfony/symfony

[Notifier] Add Sendinblue notifier.

+Sendinblue Notifier+==============++Provides Sendinblue integration for Symfony Notifier.++DSN example+-----------++```+// .env file+SENDINBLUE_MOBILE_DSN=sendinblue://API_KEY@default?sender=PHONE

But for the mailer, the env var is always named MAILER_DSN, right?

ptondereau

comment created time in 7 hours

PullRequestReviewEvent

Pull request review commentsymfony/recipes

[Webpack Encore] Change default assets directory structure

 Encore      * Each entry will result in one JavaScript file (e.g. app.js)      * and one CSS file (e.g. app.css) if your JavaScript imports CSS.      */-    .addEntry('app', './assets/js/app.js')+    .addEntry('app', './assets/app.js')     //.addEntry('page1', './assets/js/page1.js')

Shouldn't we update the commented entries as well?

tgalopin

comment created time in 8 hours

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentsymfony/symfony

[Notifier] Add Sendinblue notifier.

+Sendinblue Notifier+==============++Provides Sendinblue integration for Symfony Notifier.++DSN example+-----------++```+// .env file+SENDINBLUE_MOBILE_DSN=sendinblue://API_KEY@default?sender=PHONE

Why not use SENDINBLUE_DSN instead?

ptondereau

comment created time in 8 hours

Pull request review commentsymfony/symfony

[Notifier] Add Sendinblue notifier.

+Sendinblue Notifier+==============

Missing some = to match the title length

ptondereau

comment created time in 8 hours

PullRequestReviewEvent
PullRequestReviewEvent

push eventsymfony/symfony

Fabien Potencier

commit sha 9e4f511cbf7e2f6cb29c61869b76dfdbb2222e0d

Fix CS

view details

push time in 8 hours

PR merged symfony/symfony

Reviewers
[Messenger] Fix misleading comment about time-limit Messenger Status: Reviewed
Q A
Branch? master
Bug fix? no
New feature? no
Deprecations? no
Tickets n/a
License MIT
Doc PR n/a

The current explanation of the time-limit option of the messenger:consume command is misleading as it lets you think that this is an enforced hard limit.

For instance, you may think that a command started with --time-limit=10 will stop once 10 seconds are elapsed, no matter what.

Actually, two things happen:

  • Once 10 seconds have elapsed, then the worker won't receive and handle any other message
  • The worker will keep running until the currently handled message is fully handled so it can last way longer than 10 seconds, then it will stop.

I'm not sure this is behavior is actually a bug or not, but the current documentation does not describe the current behavior

+2 -2

2 comments

1 changed file

sylfabre

pr closed time in 8 hours

push eventsymfony/symfony

Sylvain Fabre

commit sha 21176646e9902c8eb84f5124579a2fc4d74c0b2f

[Messenger] Fix misleading comment about time-limit

view details

Fabien Potencier

commit sha 013bbcc23e1203ef2c38aca278eff33e367fc77e

minor #38303 [Messenger] Fix misleading comment about time-limit (sylfabre) This PR was merged into the 5.2-dev branch. Discussion ---------- [Messenger] Fix misleading comment about time-limit | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | n/a | License | MIT | Doc PR | n/a The current explanation of the time-limit option of the `messenger:consume` command is misleading as it lets you think that this is an enforced hard limit. For instance, you may think that a command started with `--time-limit=10` will stop once 10 seconds are elapsed, no matter what. Actually, two things happen: - Once 10 seconds have elapsed, then the worker won't receive and handle any other message - The worker will keep running until the currently handled message is fully handled so it can last way longer than 10 seconds, then it will stop. I'm not sure this is behavior is actually a bug or not, but the current documentation does not describe the current behavior Commits ------- 21176646e9 [Messenger] Fix misleading comment about time-limit

view details

push time in 8 hours

pull request commentsymfony/symfony

[Messenger] Fix misleading comment about time-limit

Thank you @sylfabre.

sylfabre

comment created time in 8 hours

PullRequestReviewEvent

PR merged symfony/symfony

[Translation] Allow Translatable objects to be used as strings Status: Reviewed Translator
Q A
Branch? master
Bug fix? no
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

Allow Translatable objects to be used as strings.

+12 -2

1 comment

2 changed files

tgalopin

pr closed time in 8 hours

push eventsymfony/symfony

Titouan Galopin

commit sha 0ba206420e687a208240c2cb1496be9261abf64c

[Translation] Allow Translatable objects to be used as strings

view details

Fabien Potencier

commit sha ffb7f0e36feb550bde39c76bb68a2441e5c24946

minor #38304 [Translation] Allow Translatable objects to be used as strings (tgalopin) This PR was merged into the 5.2-dev branch. Discussion ---------- [Translation] Allow Translatable objects to be used as strings | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Allow Translatable objects to be used as strings. Commits ------- 0ba206420e [Translation] Allow Translatable objects to be used as strings

view details

push time in 8 hours

pull request commentsymfony/symfony

[Translation] Allow Translatable objects to be used as strings

Thank you @tgalopin.

tgalopin

comment created time in 8 hours

PullRequestReviewEvent

push eventsymfony/symfony

Fabien Potencier

commit sha 6a5571552f3f56a80bcd3b5810a0fdca67fa5952

Fix CS

view details

push time in 9 hours

push eventsymfony/symfony

Steve Grunwell

commit sha 7877a5b4880f653be2a6008bea77522de242d8c4

[PhpUnitBridge] Enable a maximum PHPUnit version to be set via SYMFONY_MAX_PHPUNIT_VERSION

view details

Fabien Potencier

commit sha 02d879f6938b825c4cc29726939992aff4beaa44

feature #38305 [PhpUnitBridge] Enable a maximum PHPUnit version to be set via SYMFONY_MAX_PHPUNIT_VERSION (stevegrunwell) This PR was merged into the 5.2-dev branch. Discussion ---------- [PhpUnitBridge] Enable a maximum PHPUnit version to be set via SYMFONY_MAX_PHPUNIT_VERSION | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | none | License | MIT | Doc PR | symfony/symfony-docs#14286 This PR adds support for the `SYMFONY_MAX_PHPUNIT_VERSION` environment variable, letting users set the **maximum** version of PHPUnit to be considered when running the PHPUnit Bridge. The use case here comes from testing WordPress using the library; as of the time of this ticket, [WordPress' core test suite does not yet support PHPUnit 8.x](https://core.trac.wordpress.org/ticket/46149). As a result, trying to run the WordPress core test suite with PHPUnit Bridge results in the following error under PHP 7.2 or newer: > **Error:** Looks like you're using PHPUnit 8.3.5. WordPress requires at least PHPUnit 5.4 and is currently only compatible with PHPUnit up to 7.x. Please use the latest PHPUnit version from the 7.x branch. In this use case, the developer testing against WordPress would set `SYMFONY_MAX_PHPUNIT_VERSION=7.5` in their environment (or `phpunit.xml` file) and the PHPUnit Bridge would never go *above* that version (but would still be free to, for instance, load PHPUnit 6 when running under PHP 7.0). Commits ------- 7877a5b488 [PhpUnitBridge] Enable a maximum PHPUnit version to be set via SYMFONY_MAX_PHPUNIT_VERSION

view details

push time in 9 hours

PR merged symfony/symfony

[PhpUnitBridge] Enable a maximum PHPUnit version to be set via SYMFONY_MAX_PHPUNIT_VERSION Feature PhpUnitBridge Status: Reviewed
Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets none
License MIT
Doc PR symfony/symfony-docs#14286

This PR adds support for the SYMFONY_MAX_PHPUNIT_VERSION environment variable, letting users set the maximum version of PHPUnit to be considered when running the PHPUnit Bridge.

The use case here comes from testing WordPress using the library; as of the time of this ticket, WordPress' core test suite does not yet support PHPUnit 8.x. As a result, trying to run the WordPress core test suite with PHPUnit Bridge results in the following error under PHP 7.2 or newer:

Error: Looks like you're using PHPUnit 8.3.5. WordPress requires at least PHPUnit 5.4 and is currently only compatible with PHPUnit up to 7.x. Please use the latest PHPUnit version from the 7.x branch.

In this use case, the developer testing against WordPress would set SYMFONY_MAX_PHPUNIT_VERSION=7.5 in their environment (or phpunit.xml file) and the PHPUnit Bridge would never go above that version (but would still be free to, for instance, load PHPUnit 6 when running under PHP 7.0).

+6 -0

1 comment

1 changed file

stevegrunwell

pr closed time in 9 hours

pull request commentsymfony/symfony

[PhpUnitBridge] Enable a maximum PHPUnit version to be set via SYMFONY_MAX_PHPUNIT_VERSION

Thank you @stevegrunwell.

stevegrunwell

comment created time in 9 hours

PullRequestReviewEvent
PullRequestReviewEvent

push eventtwigphp/Twig

Oskar Stark

commit sha 4584576c87094b27c7cd8832f746b6ac4c376198

Add another paragraph about mentioning another needed library

view details

Fabien Potencier

commit sha 573c50dd67050c7de2ae29987c8a4f851a066dbc

minor #3400 Add another paragraph about mentioning another needed library (OskarStark) This PR was submitted for the 3.x branch but it was squashed and merged into the 2.x branch instead. Discussion ---------- Add another paragraph about mentioning another needed library Commits ------- 4584576c Add another paragraph about mentioning another needed library

view details

Fabien Potencier

commit sha 02586c7ad3f162b96b31e8b064cb5906a44588be

Merge branch '2.x' into 3.x * 2.x: Add another paragraph about mentioning another needed library

view details

push time in a day

push eventtwigphp/Twig

Oskar Stark

commit sha 4584576c87094b27c7cd8832f746b6ac4c376198

Add another paragraph about mentioning another needed library

view details

Fabien Potencier

commit sha 573c50dd67050c7de2ae29987c8a4f851a066dbc

minor #3400 Add another paragraph about mentioning another needed library (OskarStark) This PR was submitted for the 3.x branch but it was squashed and merged into the 2.x branch instead. Discussion ---------- Add another paragraph about mentioning another needed library Commits ------- 4584576c Add another paragraph about mentioning another needed library

view details

push time in a day

pull request commenttwigphp/Twig

Add another paragraph about mentioning another needed library

Thank you @OskarStark.

OskarStark

comment created time in a day

push eventOskarStark/Twig

Oskar Stark

commit sha 4584576c87094b27c7cd8832f746b6ac4c376198

Add another paragraph about mentioning another needed library

view details

push time in a day

issue closedsymfony/symfony

[messenger][DX] restart consumer when code changed in debug mode

Hi,

when working, it would be nice if the consumer would restart automatically when code (or configuration, etc.) has been updated

I've tried to write a middleware that would check if the cache is fresh and stop the command if not (in my case docker-compose would restart it) but I don't know how to check for that

here is what I tried:

<?php declare(strict_types=1);

namespace App\Messenger;

use Symfony\Component\Config\ConfigCache;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Middleware\MiddlewareInterface;
use Symfony\Component\Messenger\Middleware\StackInterface;

class CodeChangedMiddleware implements MiddlewareInterface
{
    /** @var Kernel */
    private $kernel;

    public function __construct(KernelInterface $kernel)
    {
        assert($kernel instanceof Kernel);
        $this->kernel = $kernel;
    }

    public function handle(Envelope $envelope, StackInterface $stack): Envelope
    {
        if (!$this->cacheIsFresh()) {
            throw new \RuntimeException("Restarting consumer to update cache");
        }

        return $stack->next()->handle($envelope, $stack);
    }

    private function cacheIsFresh(): bool
    {
        // trying to mimick what's happening at the beginning of Kernel::initializeContainer
        $ro = new \ReflectionObject($this->kernel);
        $getContainerClass = $ro->getMethod("getContainerClass");
        $getContainerClass->setAccessible(true);

        $class = $getContainerClass->invoke($this->kernel);

        $warmupDirProperty = $ro->getParentClass()->getProperty("warmupDir");
        $warmupDirProperty->setAccessible(true);
        $cacheDir = $warmupDirProperty->getValue($this->kernel) ?: $this->kernel->getCacheDir();

        $debugProperty = $ro->getProperty("debug");
        $debugProperty->setAccessible(true);
        $cache = new ConfigCache("$cacheDir/$class.php", $debugProperty->getValue($this->kernel));

        return $cache->isFresh();
    }
}

but this cache is always fresh

Do you think this is something worth integrating into symfony ? (maybe directly into the consumer command instead)

and, any idea why the middleware I wrote does not detect code changes ?

closed time in a day

mathroc

pull request commentsymfony/symfony

[Notifier ] Add Discord notifier

@connorhu Do you want to open a new PR?

mpiot

comment created time in a day

pull request commentsymfony/recipes

Add Discord notifier recipe

@symfony-flex-server review again please

mpiot

comment created time in a day

pull request commenttwigphp/Twig

Add another paragraph about mentioning another needed library

Same is true for 2.x

OskarStark

comment created time in a day

pull request commentsymfony/symfony

[Translation][FrameworkBundle] Adding Translation Providers

To be included in Symfony, Providers (like for Mailer, Messenger, or Notifier) must not rely on external third-party packages, but should use the built-in Symfony HTTP client.

welcoMattic

comment created time in a day

Pull request review commentsymfony/symfony

[lock] Provides default implementation when store does not supports the behavior

 interface SharedLockStoreInterface extends PersistingStoreInterface     /**      * Stores the resource if it's not locked for reading by someone else.      *-     * @throws NotSupportedException

I don't think so

jderusse

comment created time in a day

PullRequestReviewEvent

issue commentsymfony/flex

Sort classes on bundles.php

As I said above, order should not matter. I would even say that if the order matters, it's a bug in the bundles.

soullivaneuh

comment created time in a day

PR merged symfony/symfony

[OptionsResolver] Assert that the error type is valid in deprecations test OptionsResolver Status: Reviewed
Q A
Branch? 4.4
Bug fix? no
New feature? no
Deprecations? no
Tickets no
License MIT
Doc PR no

A change in the code could cause a warning for example and still produce the expected number of errors and the expected last error. Checking the type of the error is a little bit better. The best would be to check all the expected deprecations one by one, maybe later? 😄

+3 -1

1 comment

1 changed file

fancyweb

pr closed time in a day

push eventsymfony/symfony

Thomas Calvet

commit sha 926d18f2f910d37cd47d34b3886399422a93f7b3

[OptionsResolver] Assert that the error type is valid in deprecations test

view details

Fabien Potencier

commit sha f71d8cfabb5fe96addaf82f5c5def89f4bfec4a4

minor #38294 [OptionsResolver] Assert that the error type is valid in deprecations test (fancyweb) This PR was merged into the 4.4 branch. Discussion ---------- [OptionsResolver] Assert that the error type is valid in deprecations test | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | no | License | MIT | Doc PR | no A change in the code could cause a warning for example and still produce the expected number of errors and the expected last error. Checking the type of the error is a little bit better. The best would be to check all the expected deprecations one by one, maybe later? 😄 Commits ------- 926d18f2f9 [OptionsResolver] Assert that the error type is valid in deprecations test

view details

push time in a day

pull request commentsymfony/symfony

[OptionsResolver] Assert that the error type is valid in deprecations test

Good catch, thanks @fancyweb.

fancyweb

comment created time in a day

PullRequestReviewEvent

PR merged symfony/symfony

[OptionsResolver] Fix deprecation message access Bug OptionsResolver Status: Reviewed
Q A
Branch? 5.1
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

$this->deprecated[$option] cannot be a string, it's always an array.

+1 -1

1 comment

1 changed file

fancyweb

pr closed time in a day

push eventsymfony/symfony

Thomas Calvet

commit sha 232af423aa29f569e2f72d39fdb1861aae334efd

[OptionsResolver] Fix deprecation message access

view details

Fabien Potencier

commit sha 44bd82cb2d7073adf5dd235ae3d4ff13aa2ff12b

bug #38291 [OptionsResolver] Fix deprecation message access (fancyweb) This PR was merged into the 5.1 branch. Discussion ---------- [OptionsResolver] Fix deprecation message access | Q | A | ------------- | --- | Branch? | 5.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - `$this->deprecated[$option]` cannot be a string, it's always an array. Commits ------- 232af423aa [OptionsResolver] Fix deprecation message access

view details

push time in a day

pull request commentsymfony/symfony

[OptionsResolver] Fix deprecation message access

Thank you @fancyweb.

fancyweb

comment created time in a day

PullRequestReviewEvent

PR merged symfony/symfony

Register the binary types as well Bug Status: Reviewed
Q A
Branch? 5.2
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix -
License MIT
Doc PR symfony/symfony-docs-

Binary versions were not working since they weren't registered

+10 -0

1 comment

1 changed file

jdelaune

pr closed time in a day

push eventsymfony/symfony

Jordan de Laune

commit sha 96a0e5fca10e7e4fa0b6b3c9c8a1b5c9f57bb5d5

Register the binary types as well

view details

Fabien Potencier

commit sha e6dcf9bc03e7d1bf44a56fd4f07b698363d15066

bug #38292 Register the binary types as well (jdelaune) This PR was squashed before being merged into the 5.2-dev branch. Discussion ---------- Register the binary types as well | Q | A | ------------- | --- | Branch? | 5.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix - | License | MIT | Doc PR | symfony/symfony-docs- Binary versions were not working since they weren't registered Commits ------- 96a0e5fca1 Register the binary types as well

view details

push time in a day

push eventjdelaune/symfony

Jordan de Laune

commit sha 96a0e5fca10e7e4fa0b6b3c9c8a1b5c9f57bb5d5

Register the binary types as well

view details

push time in a day

pull request commentsymfony/symfony

Register the binary types as well

Thank you @jdelaune.

jdelaune

comment created time in a day

PullRequestReviewEvent

PR closed symfony/symfony

[WIP][Security] OAuth2 component Feature Security Status: Needs Review
Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #...
License MIT
Doc PR To add

Hi everyone 👋

Here's my first "big" PR on Symfony, recently, I've decided to implement OAuth authentication in a side-project application, in order to do it, I've used HttpClient (thanks to Nicolas Grekas) and I've been amazed by the simplicity of the implementation but something was weird ... Why Symfony doesn't have a "native" OAuth support/Client/Server/Component? Then I saw that the hackaton highlighted the idea of having a native support: https://github.com/symfony/symfony/issues/30914

So, I've decided to take time to work on a strict implementation (well, as strict as I could do) thanks to the RFC and HttpClient and here's the first result, a new "OAuth component" (actually, that's an experimentation 😄), for now, this experimentation only support the "client" aspect (the server has been started) and that I'm aware that a lot of feature can be lacking or to update.

So, why opening this PR now ?

First, I'm aware that this is a WIP and that a lot of feedback can be linked to some choices that I've made, please, do not hesitate to explain me if there's a better option/way to do it.

Second, I think that it's a good idea to discuss about this idea and explain why it's not a good idea/option to do it as a component (or even as a feature?) before going further on the development 🙂

So here's the PR with the first parts of the components, feel free to comments and have a great day 🙂

This PR replace the following: https://github.com/symfony/symfony/pull/31937

EDIT 13/06/2019:

Here's the actual documentation of this "component":

A set of class which allows to use OAuth thanks to HttpClient and OptionsResolver.

Usage

Using symfony/security-oauth-client outside of the framework is pretty straight forward.

Let's assume that we need to use the Github OAuth API.

First, let's instantiate the provider:

<?php

require __DIR__ . 'vendor/autoload.php';

use Symfony\Components\HttpClient\HttpClient;
use Symfony\Components\OAuth\Provider\AuthorizationCodeProvider;

$client = HttpClient::create();

// The provider requires the main configuration keys
$provider = new AuthorizationCodeProvider($client, [
    'client_id' => 'foo',
    'client_secret' => 'bar',
    'redirect_uri' => 'http://foo.com/',
    'authorization_url' => 'https://github.com/login/oauth/authorize',
    'accessToken_url' => 'https://github.com/login/oauth/access_token',
    'userDetails_url' => 'https://api.github.com/user',
]);

// In the case that a provider cannot fetch an authorization code, a \RuntimeException is thrown
$authenticationCode = $provider->fetchAuthorizationCode([
    'scope' => 'public', 
    'state' => 'randomstring',
]);

// if you need it, you can use the `AuthorizationCodeResponse::get*` methods to access both code and state
// Once the authentication code is fetched, time to receive the access_token

$accessToken = $provider->fetchAccessToken(['code' => $authenticationCode->getCode()]); 

// Now, we can use use the received `AuthorizationCodeGrantAccessToken` object value to fetch the user details
// The $clientProfileLoader is prepared by the GenericProvider
$clientProfileLoader = $provider->prepareClientProfileLoader();

// The $userDate is a `ClientProfile` object
$userData = $clientProfileLoader->fetchClientProfile($accessToken->getTokenValue('access_token'));

echo $userData->get('login'); // Display Bob Foo

Informations

  • The constructor arguments order of GenericProvider can probably be improved.
  • The AuthorizationCodeGrantAccessToken::getOptionValue() is similar to ParameterBag::get().
  • The AuthorizationCodeResponse isn't critical as it's a simple "DTO", we can easily return an array.
  • For now, the Symfony\Components\OAuth\Provider\GenericProvider doesn't allow to fetch the user details directly (as it's not part of the RFC), the final request is up to the user.
  • If an error occurs, no message are returned for now, it could be a good idea to return the error key returned by the API.
  • No implementation is available on the full-stack framework for now.
  • The Symfony\Component\OAuth\Provider\ProviderInterface can benefit of having the fetchAuthorizationCode and fetchAccessToken methods if a contract is created.
  • The \RuntimeException which is thrown during the $provider->fetchAuthenticationCode call (if the provider can't use it) can be moved to a trigger_error.

Supported providers

For now, the component deliver the main providers described in the RFC: https://tools.ietf.org/html/rfc6749

Tests

The component isn't fully tested as it's considered as a POC, the main providers are tested and validated. The tokens should be fully tested.

Framework integration (WIP)

This part isn't ready to use, it's just an idea

As an application can use multiples providers, it could be a good idea to allows to use a factory (like HttpClient?):

framework:
    oauth:
        redirect_uri: '%env(REDIRECT_URI)%' # Can be useful in order to share the configuration?
        providers:
            github:
                type: 'authorization_code'
                    client_id: '%env(CLIENT_ID)%'
                    client_secret: '%env(CLIENT_SECRET)%'
                    authorization_url: '%env(API_AUTHORIZATION_URL)%'
                    access_token_url: '%env(API_ACCESS_TOKEN_URL)%'
            google: 
                type: 'authorization_code' # Can be authorization_code, implicit, client_credentials or resource_owner

This way, a newly created service can be accessed via @oauth.github, time to configure the security.yaml:

security:
    providers:
        github_oauth:
            oauth:
                provider: '@oauth.github' # Or maybe '@oauth.google'? 
    
    firewalls:
        main:
            provider: github_oauth
            

Let's imagine that we need to inject the provider in a service:

<?php

namespace App\Services;

use Symfony\Component\OAuth\Provider\ProviderInterface; // Maybe a contract?

class Foo 
{
    private $oauthGithub;
    
    public function __construct(ProviderInterface $oauthGithub) 
    {
        $this->oauthGithub = $oauthGithub;
    }
    
    // ...
}

Creating a custom provider

As the component allows to use a ProviderInterface, creating a custom provider is as easy as it sounds:

<?php

use Symfony\Component\OAuth\Provider\ProviderInterface;

class FooProvider implements ProviderInterface 
{
    public function fetchAccessToken(array $options,array $headers = [],string $method = 'GET')
    {
        // ...
    }
    
    // ...
}

Or if needed, we can directly extends the GenericProvider class.

+3727 -0

31 comments

67 changed files

Guikingone

pr closed time in 2 days

pull request commentsymfony/symfony

[WIP][Security] OAuth2 component

I agree with @wouterj that having support for HttpClient in League OAuth package would be much better (https://github.com/thephpleague/oauth2-client).

Guikingone

comment created time in 2 days

PR closed symfony/symfony-docs

[FrameworkBundle] [Routing] Added --sort to debug:router FrameworkBundle Routing Status: Needs Review Waiting Code Merge

Related to symfony/symfony#36579, waiting for review.

<!--

If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches).

If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and master for features of unreleased versions).

-->

+17 -0

0 comment

1 changed file

vjandrea

pr closed time in 2 days

PR closed symfony/symfony

Reviewers
[FrameworkBundle] [Routing] Added --sort to debug:router Feature FrameworkBundle Routing Status: Needs Work
Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets
License MIT
Doc PR symfony/symfony-docs#13591

This PR adds a --sortfunctionality to console debug:router. It allows to sort by name, path or priority (default).

+212 -1

11 comments

3 changed files

vjandrea

pr closed time in 2 days

pull request commentsymfony/symfony

[FrameworkBundle] [Routing] Added --sort to debug:router

Re-reading the whole thing, I think that having a --sort flag is wrong for the reasons explained by @Tobion. As the output of a command can be piped through any other command, I think we don't need to support this in core. Let's close.

vjandrea

comment created time in 2 days

PR closed symfony/symfony

[Console] Add Question::setDefault Console Feature Status: Needs Work
Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets no
License MIT
Doc PR documented with getDefault

<!-- This adds a setDefault method to the Question class so that the default can be changed after object creation. This is useful when eg. reading in config after the questions have been created, and changing the defaults based on the config.

Could not find any documentation for getDefault, so I added the documentation for setDefault right next to it (ie. there is none).

Could also not figure out a way to run tests without submitting a pull request.

Additionally (see https://symfony.com/releases):

  • Always add tests and ensure they pass.
  • Never break backward compatibility (see https://symfony.com/bc).
  • 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 branch master. -->
+24 -0

4 comments

3 changed files

tnelson-doghouse

pr closed time in 2 days

pull request commentsymfony/symfony

[Console] Add Question::setDefault

The more I think about this one, the more I think we should not add this method (if we go down this path, why not add setQuestion() as well then? In which case creating a new Question instance would make more sense). The use case is an edge case.

tnelson-doghouse

comment created time in 2 days

issue closedsymfony/symfony

Contract for accessing constraint violation list iterator

Symfony version(s) affected: 5.1.5

Description
Currently Symfony\Component\Validator\ConstraintViolationListInterface does not offer method for accessing iterator. There is getIterator() as a part ConstraintViolationList concrete implementation which also implements IteratorAggregate interface, however Symfony\Component\Messenger\Exception\ValidationFailedException::getViolations() return type points to interface, not implementation. In result, it's "impossible" to access iterator when type-hinting to ConstraintViolationListInterface interface.

How to reproduce

<?php

use Symfony\Component\Messenger\Exception\ValidationFailedException;
use Symfony\Component\Validator\ConstraintViolationInterface;

try {
    ...
} catch (ValidationFailedException $e) {
    dd(array_map(
        static fn (ConstraintViolationInterface $violation) => [
            $violation->getPropertyPath(),
            $violation->getMessage(),
        ],
        // Psalm complains: Method Symfony\Component\Validator\ConstraintViolationListInterface::getIterator does not exist
        (array) $e->getViolations()->getIterator()
    ));
}

Possible Solution
Move implements \IteratorAggregate from ConstraintViolationList to ConstraintViolationListInterface (as extends \IteratorAggregate, obviously). I've tried it locally and Psalm doesn't raise an error.

Additional context
In Symfony app it works (because of implementation), the problem is with static analysis.

closed time in 2 days

Wirone

pull request commentsymfony/symfony

Make Translator::getLocale() behave the same as TranslatorTrait::getLocale()

@jschaedl Can you remove the deprecation and fix the getLocale method?

jschaedl

comment created time in 2 days

PR merged symfony/symfony

[DomCrawler] Add `assertFormValue()` in `WebTestCase` DomCrawler Feature Status: Reviewed
Q A
Branch? master for features
Bug fix? no
New feature? yes <!-- please update src/**/CHANGELOG.md files -->
Deprecations? no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
Tickets
License MIT
Doc PR symfony/symfony-docs#... <!-- required for new features -->

Add new assertions for checking form values, to use in functional tests.

Example:

    public function testForm()
    {
        $this->visit('/edit-form');

        self::assertNoFormValue('#form', 'activateMembership'); // checkboxes don't have values when unchecked
        self::assertFormValue('#form', 'trialPeriod', '15');

        $this->client->submitForm('Save', [
            'activateMembership' => 'on',
            'trialPeriod' => '7',
        ]);

        self::assertResponseIsSuccessful();
        self::assertFormValue('#form', 'activateMembership', 'on');
        self::assertFormValue('#form', 'trialPeriod', '7');
    }

I resorted to using the ->form() API because:

  • checking the value of checkboxes was not possible today via existing assertions (I opened #38287 for that)
  • checking the value of selects was impossible using CSS selectors (as far as I know), but possible with the ->form() helper
+34 -0

1 comment

3 changed files

mnapoli

pr closed time in 2 days

push eventsymfony/symfony

Matthieu Napoli

commit sha c3e0336596fdd5b9336950b5d27bb0359f6c226e

[DomCrawler] Add `assertFormValue()` and `assertNoFormValue()` in `WebTestCase`

view details

Fabien Potencier

commit sha 713f30efafa8ac3e70bf21e77a1359c151f199ba

feature #38288 [DomCrawler] Add `assertFormValue()` in `WebTestCase` (mnapoli) This PR was merged into the 5.2-dev branch. Discussion ---------- [DomCrawler] Add `assertFormValue()` in `WebTestCase` | Q | A | ------------- | --- | Branch? | master for features | Bug fix? | no | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Add new assertions for checking form values, to use in functional tests. Example: ```php public function testForm() { $this->visit('/edit-form'); self::assertNoFormValue('#form', 'activateMembership'); // checkboxes don't have values when unchecked self::assertFormValue('#form', 'trialPeriod', '15'); $this->client->submitForm('Save', [ 'activateMembership' => 'on', 'trialPeriod' => '7', ]); self::assertResponseIsSuccessful(); self::assertFormValue('#form', 'activateMembership', 'on'); self::assertFormValue('#form', 'trialPeriod', '7'); } ``` I resorted to using the `->form()` API because: - checking the value of checkboxes was not possible today via existing assertions (I opened #38287 for that) - checking the value of selects was impossible using CSS selectors (as far as I know), but possible with the `->form()` helper Commits ------- c3e0336596 [DomCrawler] Add `assertFormValue()` and `assertNoFormValue()` in `WebTestCase`

view details

push time in 2 days

issue openedsymfony/symfony-docs

[DomCrawler] Add `assertFormValue()` in `WebTestCase`

Q A
Feature PR symfony/symfony#38288
PR author(s) @mnapoli
Merged in 5.2-dev

created time in 2 days

pull request commentsymfony/symfony

[DomCrawler] Add `assertFormValue()` in `WebTestCase`

Thank you @mnapoli.

mnapoli

comment created time in 2 days

push eventmnapoli/symfony

HypeMC

commit sha 9c3498086983f76b114a6e275133675d99ba036b

Auto-register kernel as an extension

view details

Manuel Alejandro Paz Cetina

commit sha 33e78b43a4a48f6855f2df274d5e3ccaca1f54ef

Always require SQL comment hint

view details

Matthieu Napoli

commit sha f26758e1c02c94f10ab1abfb46b35b3af611214f

[DomCrawler] Add `assertCheckboxChecked()`

view details

Fabien Potencier

commit sha d635390a3988997ea160a0148e3fe59fdfde6f8d

bug #38273 Always require SQL comment hint (lexthink) This PR was merged into the 5.2-dev branch. Discussion ---------- Always require SQL comment hint | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | The `GuidType` does not always return true, because it is mapped to the native uuid type if available. But `AbstractBinaryUidType` and `AbstractUidType` are not mapped like that, so they always requires the comment hint to avoid issues when diffing the schema (the DB introspection would detect a `GuidType` and so a change would be needed). Commits ------- 33e78b43a4 Always require SQL comment hint

view details

Kevin Bond

commit sha f20a318f37b5f74c8f6d5e9ef1df4d219a9c7628

[String] allow passing null to string functions

view details

Fabien Potencier

commit sha aa5d0ea829a17a7599e219735358d483943ca56e

feature #38269 [String] allow passing null to string functions (kbond) This PR was submitted for the 5.1 branch but it was merged into the 5.2-dev branch instead. Discussion ---------- [String] allow passing null to string functions | Q | A | ------------- | --- | Branch? | 5.1 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #38260 | License | MIT | Doc PR | n/a I also added a default value for `s` to match the other functions. Commits ------- f20a318f37 [String] allow passing null to string functions

view details

Romaric Drigon

commit sha f7312a48ea0a7ff077d33f8733feb57ee4b8e7a1

[Form] Added "html5" option to both MoneyType and PercentType

view details

Fabien Potencier

commit sha 2e819f3ba9cca8ff02b06a404fe060d9db761a44

Revert "feature #33381 [Form] dispatch submit events for disabled forms too (xabbuh)" This reverts commit dc63d712aba9bfa27e39188f909d5618972507ff, reversing changes made to 59ae592909aab5432e4184c2713602f61d497468.

view details

Fabien Potencier

commit sha 6e9949b9b26a8b20d94f5e33a0eecfb30279f269

feature #35956 [Form] Added "html5" option to both MoneyType and PercentType (romaricdrigon) This PR was merged into the 5.2-dev branch. Discussion ---------- [Form] Added "html5" option to both MoneyType and PercentType | Q | A | ------------- | --- | Branch? | master for features | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | TBD Hello, In the same way that [NumberType](https://symfony.com/doc/current/reference/forms/types/number.html) offers a `html5` option to render a `number` input instead of a `text` input, this PR adds the same option to both `MoneyType` and `PercentType`. Number inputs offer a better UI, especially on mobile (specific keyboard), and they accept extra HTML attributes, such as `max=100`, which are quite useful. The challenge is that `number` inputs need a "raw" value, nor formatted nor localized. Format is described here https://www.w3.org/TR/html51/sec-forms.html#date-time-and-number-formats (non-normative, but tested on a few browsers). It matches number formatting for `en` locale (which is great, since it is the one provided by Symfony Intl polyflil), without grouping. Implementation was done in a manner similar to `NumberType` for `MoneyType`. `PercentType` required to modify `PercentToLocalizedStringTransformer` too. As a bonus, `PercentType` had no tests at all, I added a few. I wanted to get some feedback on the idea first, remaining steps: - update `CHANGELOG.md` - update the doc Commits ------- f7312a48ea [Form] Added "html5" option to both MoneyType and PercentType

view details

drixs6o9

commit sha 836a20350bede027c28cd727099fa30441488854

[Mailer] Added Sendinblue bridge

view details

Fabien Potencier

commit sha 5c48235e71f1c4187006cd01c2557c2b8258fc16

feature #38277 [Mailer] Added Sendinblue bridge (drixs6o9) This PR was squashed before being merged into the 5.2-dev branch. Discussion ---------- [Mailer] Added Sendinblue bridge | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | License | MIT | Doc PR | [https://github.com/symfony/symfony-docs/pull/14272](https://github.com/symfony/symfony-docs/pull/14272) | Recipe | [https://github.com/symfony/recipes/pull/822](https://github.com/symfony/recipes/pull/822) <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Never break backward compatibility (see https://symfony.com/bc). - 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 branch master. --> N.B. I had a little help from [Pierre TONDEREAU](https://github.com/ptondereau) for the API. Commits ------- 836a20350b [Mailer] Added Sendinblue bridge

view details

Fabien Potencier

commit sha 59f712475b7bc9ffc36895eb05d1e8c1b231a272

feature #38243 [HttpKernel] Auto-register kernel as an extension (HypeMC) This PR was merged into the 5.2-dev branch. Discussion ---------- [HttpKernel] Auto-register kernel as an extension | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Symfony already supports having the kernel as an extension. This is evident by the fact that the [`config:dump-reference` and `debug:config`](https://github.com/symfony/symfony/pull/36186) commands check whether the kernel implements the `ExtensionInterface`. Nonetheless, it's still required to register the kernel manually as an extension. With this PR the kernel will be automatically registered as an extension if it implements the `ExtensionInterface`. This is the same logic as when the kernel implements the `CompilerPassInterface`. Commits ------- 9c34980869 Auto-register kernel as an extension

view details

Przemysław Bogusz

commit sha c77730699e2ff59f8204556e5e2178c66412b541

[Validator] Add invalid datetime message in Range validator

view details

Fabien Potencier

commit sha 2bdcf4ac8f86874ceaf1be5edd0f6b7490ae2dc9

feature #36326 [Validator] Add invalid datetime message in Range validator (przemyslaw-bogusz) This PR was squashed before being merged into the 5.2-dev branch. Discussion ---------- [Validator] Add invalid datetime message in Range validator | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - When the validated value is invalid (it isn't a number nor a datetime), but `min` or `max` option indicate that the `Range` constraint is being used to validate a datetime, the displayed message will be `This value should be a valid datetime` instead of `This value should be a valid number`. This PR replaces #35998. Commits ------- c77730699e [Validator] Add invalid datetime message in Range validator

view details

Fabien Potencier

commit sha af90e1e2860d20348184f886c10f4616e1d12a9b

feature #38287 [DomCrawler] Add checkbox assertions for functional tests (mnapoli) This PR was merged into the 5.2-dev branch. Discussion ---------- [DomCrawler] Add checkbox assertions for functional tests | Q | A | ------------- | --- | Branch? | master for features | Bug fix? | no | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Add new assertions for checkboxes, to use in functional tests. Example: ```php public function testAssertCheckboxChecked() { $this->visit('/edit-form'); $this->client->submitForm('Save', [ 'activateMembership' => 'on', ]); self::assertResponseIsSuccessful(); // Check that the field is checked after the form was submitted self::assertCheckboxChecked('activateMembership'); } ``` This wasn't possible to achieve with the existing `self::assertInputValueSame()` assertion. Commits ------- f26758e1c0 [DomCrawler] Add `assertCheckboxChecked()`

view details

Matthieu Napoli

commit sha c3e0336596fdd5b9336950b5d27bb0359f6c226e

[DomCrawler] Add `assertFormValue()` and `assertNoFormValue()` in `WebTestCase`

view details

push time in 2 days

PullRequestReviewEvent

PR merged symfony/symfony

[DomCrawler] Add checkbox assertions for functional tests DomCrawler Feature Status: Reviewed
Q A
Branch? master for features
Bug fix? no
New feature? yes <!-- please update src/**/CHANGELOG.md files -->
Deprecations? no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
Tickets
License MIT
Doc PR symfony/symfony-docs#... <!-- required for new features -->

Add new assertions for checkboxes, to use in functional tests.

Example:

    public function testAssertCheckboxChecked()
    {
        $this->visit('/edit-form');

        $this->client->submitForm('Save', [
            'activateMembership' => 'on',
        ]);

        self::assertResponseIsSuccessful();
        // Check that the field is checked after the form was submitted
        self::assertCheckboxChecked('activateMembership');
    }

This wasn't possible to achieve with the existing self::assertInputValueSame() assertion.

+35 -0

2 comments

3 changed files

mnapoli

pr closed time in 2 days

push eventsymfony/symfony

Matthieu Napoli

commit sha f26758e1c02c94f10ab1abfb46b35b3af611214f

[DomCrawler] Add `assertCheckboxChecked()`

view details

Fabien Potencier

commit sha af90e1e2860d20348184f886c10f4616e1d12a9b

feature #38287 [DomCrawler] Add checkbox assertions for functional tests (mnapoli) This PR was merged into the 5.2-dev branch. Discussion ---------- [DomCrawler] Add checkbox assertions for functional tests | Q | A | ------------- | --- | Branch? | master for features | Bug fix? | no | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Add new assertions for checkboxes, to use in functional tests. Example: ```php public function testAssertCheckboxChecked() { $this->visit('/edit-form'); $this->client->submitForm('Save', [ 'activateMembership' => 'on', ]); self::assertResponseIsSuccessful(); // Check that the field is checked after the form was submitted self::assertCheckboxChecked('activateMembership'); } ``` This wasn't possible to achieve with the existing `self::assertInputValueSame()` assertion. Commits ------- f26758e1c0 [DomCrawler] Add `assertCheckboxChecked()`

view details

push time in 2 days

issue openedsymfony/symfony-docs

[DomCrawler] Add checkbox assertions for functional tests

Q A
Feature PR symfony/symfony#38287
PR author(s) @mnapoli
Merged in 5.2-dev

created time in 2 days

pull request commentsymfony/symfony

[DomCrawler] Add checkbox assertions for functional tests

Thank you @mnapoli.

mnapoli

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent

PR merged symfony/symfony

Reviewers
[Validator] Add invalid datetime message in Range validator Bug Status: Reviewed Validator
Q A
Branch? 3.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

When the validated value is invalid (it isn't a number nor a datetime), but min or max option indicate that the Range constraint is being used to validate a datetime, the displayed message will be This value should be a valid datetime instead of This value should be a valid number. This PR replaces #35998.

+127 -11

5 comments

3 changed files

przemyslaw-bogusz

pr closed time in 2 days

push eventsymfony/symfony

Przemysław Bogusz

commit sha c77730699e2ff59f8204556e5e2178c66412b541

[Validator] Add invalid datetime message in Range validator

view details

Fabien Potencier

commit sha 2bdcf4ac8f86874ceaf1be5edd0f6b7490ae2dc9

feature #36326 [Validator] Add invalid datetime message in Range validator (przemyslaw-bogusz) This PR was squashed before being merged into the 5.2-dev branch. Discussion ---------- [Validator] Add invalid datetime message in Range validator | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - When the validated value is invalid (it isn't a number nor a datetime), but `min` or `max` option indicate that the `Range` constraint is being used to validate a datetime, the displayed message will be `This value should be a valid datetime` instead of `This value should be a valid number`. This PR replaces #35998. Commits ------- c77730699e [Validator] Add invalid datetime message in Range validator

view details

push time in 2 days

issue openedsymfony/symfony-docs

[Validator] Add invalid datetime message in Range validator

Q A
Feature PR symfony/symfony#36326
PR author(s) @przemyslaw-bogusz
Merged in 5.2-dev

created time in 2 days

pull request commentsymfony/symfony

[Validator] Add invalid datetime message in Range validator

Thank you @przemyslaw-bogusz.

przemyslaw-bogusz

comment created time in 2 days

push eventprzemyslaw-bogusz/symfony

Przemysław Bogusz

commit sha c77730699e2ff59f8204556e5e2178c66412b541

[Validator] Add invalid datetime message in Range validator

view details

push time in 2 days

PullRequestReviewEvent

PR merged symfony/symfony

[HttpKernel] Auto-register kernel as an extension Feature HttpKernel Status: Reviewed
Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets -
License MIT
Doc PR -

Symfony already supports having the kernel as an extension. This is evident by the fact that the config:dump-reference and debug:config commands check whether the kernel implements the ExtensionInterface. Nonetheless, it's still required to register the kernel manually as an extension.

With this PR the kernel will be automatically registered as an extension if it implements the ExtensionInterface. This is the same logic as when the kernel implements the CompilerPassInterface.

+34 -0

1 comment

3 changed files

HypeMC

pr closed time in 2 days

push eventsymfony/symfony

HypeMC

commit sha 9c3498086983f76b114a6e275133675d99ba036b

Auto-register kernel as an extension

view details

Fabien Potencier

commit sha 59f712475b7bc9ffc36895eb05d1e8c1b231a272

feature #38243 [HttpKernel] Auto-register kernel as an extension (HypeMC) This PR was merged into the 5.2-dev branch. Discussion ---------- [HttpKernel] Auto-register kernel as an extension | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Symfony already supports having the kernel as an extension. This is evident by the fact that the [`config:dump-reference` and `debug:config`](https://github.com/symfony/symfony/pull/36186) commands check whether the kernel implements the `ExtensionInterface`. Nonetheless, it's still required to register the kernel manually as an extension. With this PR the kernel will be automatically registered as an extension if it implements the `ExtensionInterface`. This is the same logic as when the kernel implements the `CompilerPassInterface`. Commits ------- 9c34980869 Auto-register kernel as an extension

view details

push time in 2 days

issue openedsymfony/symfony-docs

[HttpKernel] Auto-register kernel as an extension

Q A
Feature PR symfony/symfony#38243
PR author(s) @HypeMC
Merged in 5.2-dev

created time in 2 days

pull request commentsymfony/symfony

[HttpKernel] Auto-register kernel as an extension

Thank you @HypeMC.

HypeMC

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent

pull request commentsymfony/recipes

[Mailer] Added Sendinblue bridge recipe

@symfony-flex-server review again please

drixs6o9

comment created time in 2 days

pull request commentsymfony/recipes

[Mailer] Added Sendinblue bridge recipe

@symfony-flex-server review again please

drixs6o9

comment created time in 2 days

created repositorysymfony/sendinblue-mailer

created time in 2 days

PR merged symfony/symfony

[Mailer] Added Sendinblue bridge Feature Mailer Status: Reviewed
Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
License MIT
Doc PR https://github.com/symfony/symfony-docs/pull/14272
Recipe https://github.com/symfony/recipes/pull/822

<!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/releases):

  • Always add tests and ensure they pass.
  • Never break backward compatibility (see https://symfony.com/bc).
  • 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 branch master. -->

N.B. I had a little help from Pierre TONDEREAU for the API.

+645 -0

1 comment

16 changed files

drixs6o9

pr closed time in 2 days

push eventsymfony/symfony

drixs6o9

commit sha 836a20350bede027c28cd727099fa30441488854

[Mailer] Added Sendinblue bridge

view details

Fabien Potencier

commit sha 5c48235e71f1c4187006cd01c2557c2b8258fc16

feature #38277 [Mailer] Added Sendinblue bridge (drixs6o9) This PR was squashed before being merged into the 5.2-dev branch. Discussion ---------- [Mailer] Added Sendinblue bridge | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | License | MIT | Doc PR | [https://github.com/symfony/symfony-docs/pull/14272](https://github.com/symfony/symfony-docs/pull/14272) | Recipe | [https://github.com/symfony/recipes/pull/822](https://github.com/symfony/recipes/pull/822) <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Never break backward compatibility (see https://symfony.com/bc). - 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 branch master. --> N.B. I had a little help from [Pierre TONDEREAU](https://github.com/ptondereau) for the API. Commits ------- 836a20350b [Mailer] Added Sendinblue bridge

view details

push time in 2 days

pull request commentsymfony/symfony

[Mailer] Added Sendinblue bridge

Thank you @drixs6o9.

drixs6o9

comment created time in 2 days

push eventdrixs6o9/symfony

drixs6o9

commit sha 836a20350bede027c28cd727099fa30441488854

[Mailer] Added Sendinblue bridge

view details

push time in 2 days

PullRequestReviewEvent

PR merged symfony/symfony

[Form] Added "html5" option to both MoneyType and PercentType Feature Form Status: Reviewed
Q A
Branch? master for features
Bug fix? no
New feature? yes
Deprecations? no
Tickets -
License MIT
Doc PR TBD

Hello,

In the same way that NumberType offers a html5 option to render a number input instead of a text input, this PR adds the same option to both MoneyType and PercentType. Number inputs offer a better UI, especially on mobile (specific keyboard), and they accept extra HTML attributes, such as max=100, which are quite useful.

The challenge is that number inputs need a "raw" value, nor formatted nor localized. Format is described here https://www.w3.org/TR/html51/sec-forms.html#date-time-and-number-formats (non-normative, but tested on a few browsers). It matches number formatting for en locale (which is great, since it is the one provided by Symfony Intl polyflil), without grouping.

Implementation was done in a manner similar to NumberType for MoneyType. PercentType required to modify PercentToLocalizedStringTransformer too.

As a bonus, PercentType had no tests at all, I added a few.

I wanted to get some feedback on the idea first, remaining steps:

  • update CHANGELOG.md
  • update the doc
+188 -8

8 comments

8 changed files

romaricdrigon

pr closed time in 2 days

push eventsymfony/symfony

Romaric Drigon

commit sha f7312a48ea0a7ff077d33f8733feb57ee4b8e7a1

[Form] Added "html5" option to both MoneyType and PercentType

view details

Fabien Potencier

commit sha 6e9949b9b26a8b20d94f5e33a0eecfb30279f269

feature #35956 [Form] Added "html5" option to both MoneyType and PercentType (romaricdrigon) This PR was merged into the 5.2-dev branch. Discussion ---------- [Form] Added "html5" option to both MoneyType and PercentType | Q | A | ------------- | --- | Branch? | master for features | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | TBD Hello, In the same way that [NumberType](https://symfony.com/doc/current/reference/forms/types/number.html) offers a `html5` option to render a `number` input instead of a `text` input, this PR adds the same option to both `MoneyType` and `PercentType`. Number inputs offer a better UI, especially on mobile (specific keyboard), and they accept extra HTML attributes, such as `max=100`, which are quite useful. The challenge is that `number` inputs need a "raw" value, nor formatted nor localized. Format is described here https://www.w3.org/TR/html51/sec-forms.html#date-time-and-number-formats (non-normative, but tested on a few browsers). It matches number formatting for `en` locale (which is great, since it is the one provided by Symfony Intl polyflil), without grouping. Implementation was done in a manner similar to `NumberType` for `MoneyType`. `PercentType` required to modify `PercentToLocalizedStringTransformer` too. As a bonus, `PercentType` had no tests at all, I added a few. I wanted to get some feedback on the idea first, remaining steps: - update `CHANGELOG.md` - update the doc Commits ------- f7312a48ea [Form] Added "html5" option to both MoneyType and PercentType

view details

push time in 2 days

issue openedsymfony/symfony-docs

[Form] Added "html5" option to both MoneyType and PercentType

Q A
Feature PR symfony/symfony#35956
PR author(s) @romaricdrigon
Merged in 5.2-dev

created time in 2 days

pull request commentsymfony/symfony

[Form] Added "html5" option to both MoneyType and PercentType

Thank you @romaricdrigon.

romaricdrigon

comment created time in 2 days

Pull request review commentsymfony/symfony

[Messenger] Add possibility to route delayed messages to the origin queue directly

 public static function createFromAmqpEnvelope(\AMQPEnvelope $amqpEnvelope, self         $attr['type'] = $attr['type'] ?? $amqpEnvelope->getType();         $attr['reply_to'] = $attr['reply_to'] ?? $amqpEnvelope->getReplyTo(); -        return new self($previousStamp->routingKey ?? $amqpEnvelope->getRoutingKey(), $previousStamp->flags ?? \AMQP_NOPARAM, $attr);+        return new self(+            $previousStamp->routingKey ?? $amqpEnvelope->getRoutingKey(),+            $previousStamp->flags ?? \AMQP_NOPARAM,+            $attr,+            $originQueueName+        );

Should be kept on one line.

s-code

comment created time in 2 days

Pull request review commentsymfony/symfony

[Messenger] Add possibility to route delayed messages to the origin queue directly

 public function send(Envelope $envelope): Envelope          $amqpReceivedStamp = $envelope->last(AmqpReceivedStamp::class);         if ($amqpReceivedStamp instanceof AmqpReceivedStamp) {-            $amqpStamp = AmqpStamp::createFromAmqpEnvelope($amqpReceivedStamp->getAmqpEnvelope(), $amqpStamp);+            $amqpStamp = AmqpStamp::createFromAmqpEnvelope(+                $amqpReceivedStamp->getAmqpEnvelope(),+                $amqpStamp,+                $amqpReceivedStamp->getQueueName()+            );

Should be kept on one line

s-code

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent

push eventsymfony/symfony

Fabien Potencier

commit sha 2e819f3ba9cca8ff02b06a404fe060d9db761a44

Revert "feature #33381 [Form] dispatch submit events for disabled forms too (xabbuh)" This reverts commit dc63d712aba9bfa27e39188f909d5618972507ff, reversing changes made to 59ae592909aab5432e4184c2713602f61d497468.

view details

push time in 2 days

more