symfony
Repos
239

The Symfony PHP framework

27461
8581

The Symfony documentation

1988
4727

The Symfony skeleton

552
124

A simple but powerful API for processing & compiling assets built around Webpack

2083
182

PHP polyfills

2115
117

Symfony Demo Application

2209
1370

Events

pull request opened
Add recipe provider which loads recipes directly from the bundle.

This feature adds a "LocalRecipeProvider", that also looks in installed bundles for installable recipes.

I couldn't unit test this, as phpunit throws errors, when I try to run it. PHP Parse error: syntax error, unexpected '=' in /opt/project/vendor/symfony/string/Resources/functions.php on line 34

Also I don't know the requirements for a pull request.

If there are any, that I have missed, please let me know.

Created at 6 hours ago
started
Created at 6 hours ago
Created at 6 hours ago
Created at 6 hours ago
Created at 6 hours ago
started
Created at 6 hours ago
Created at 7 hours ago
Created at 7 hours ago
issue comment
[make:entity] error after asking to "mark this class as an API Platform resource"

I wonder if this is caused by something new in API Platform 2.7 specifically (that's the version @riadxo was using).

As far as I know API Platform 2.7 has deprecated use ApiPlatform\Core\Annotation\ApiResource;, it is now necessary to use use ApiPlatform\Metadata\ApiResource;.

If you want it to work with PHP 7.4, Symfony 5.X and Api Platform 2.7, you have to manually change this use ApiPlatform\Metadata\ApiResource; to this use ApiPlatform\Core\Annotation\ApiResource; and added this in api_platform.yaml metadata_backward_compatibility_layer: false. But this does not solve the problem in the console...

Created at 7 hours ago
opened issue
The make: command doesn't run correctly when an entity with annotations is found.

Hi I don't speak english very well, so i write comment in French.

Je travaille sur un nouveau projet avec api-platform. Après avoir mis en place le système d'authentification par le biais de lexik/LexikJWTAuthenticationBundle, j'ai voulu implémenté un système de rafraîchissement de token avec markitosgv/JWTRefreshTokenBundle. Ce bundle génére une entité qui utilise les annotations. Mais cette entité empêche le maker-bundle de fonctionner correctement.

Created at 9 hours ago
issue comment
[Vue] Allow passing multiple contexts

I think the behavior you describe is the expected one as right now this is already not possible without aliasing an import of the component and using different html tags.

If the script detects more than one component I would throw an error that more than one component with the same name was found.

Unfortunately I am very busy until next week so can not send an updated commit yet.

Created at 9 hours ago
Created at 9 hours ago
issue comment
add translation for afrikaans

@lacpandore You didn't answer my question on another issue. We won't accept PRs if these translations are done via a tool like Google translate or Deepl. Please, confirm that you are indeed fluent in all the languages for which you're opening PRs.

Created at 10 hours ago
started
Created at 10 hours ago
opened issue
[symfony/mailjet-mailer] JSON payload for X-MJ-Vars only allows for a max depth of two (2)

Symfony version(s) affected

6.1.*

Description

When using der MailJet Mailer component using the MailJet API in conjunction with template variables, the MailJet component only allows for a max depth of two (2), thus we're getting the following error while trying to send emails:

JsonException
in vendor/symfony/mailjet-mailer/Transport/MailjetApiTransport.php (line 204)

    private function castCustomHeader(string $value, string $type)
    {
        return match ($type) {
            'bool' => filter_var($value, \FILTER_VALIDATE_BOOLEAN),
            'int' => (int) $value,
            'json' => json_decode($value, true, 2, \JSON_THROW_ON_ERROR),
            'string' => $value,
        };
    }
}

When using the MailJet PHP API (https://github.com/mailjet/mailjet-apiv3-php) there's no limitation to the depth of the variable template payload.

How to reproduce

  1. Create a free MailJet account for using the MailJet API
  2. Create a new Symfony app
  3. Require both symfony/mailer and symfony/mailjet-mailer using composer
  4. Configure the MAILER_DSN to use the MailJet API transport as described in the documentation https://symfony.com/doc/current/mailer.html#using-a-3rd-party-transport
  5. Try to send an email that uses MailJet templates and add a multi-dimensional array for template variables

Example:

$templateId = 1337;

$templateVars = [
    'foo' => [
        'bar' => 'baz',
    ],
];

$email = (new Symfony\Component\Mime\Email())
    ->from('foo@localhost')
    ->to('bar@localhost')
    ->subject('Test email');
    
$email->text('Ignored, because using MailJet templates');

$email
    ->getHeaders()
    ->addTextHeader('X-MJ-TemplateLanguage', 'true')
    ->addTextHeader('X-MJ-TemplateID', $templateId)
    ->addTextHeader('X-MJ-Vars', \json_encode($templateVars));
    
$this->mailer->send($email);

Possible Solution

Remove the limitation that allows for only a max depth of 2 levels here: https://github.com/symfony/mailjet-mailer/blob/6.1/Transport/MailjetApiTransport.php#L204

Additional Context

No response

Created at 10 hours ago
issue comment
[WebProfiler] Time Shift with Clock

you cannot shift a request that was already executed. absolutely true.

it would be a mixture of information of the recent request and a UI element to control a mock for the upcoming requests

image

Created at 10 hours ago
issue comment
symfony/console 5.4.12 make db Too many connection errors

We are using Spryker and do an import every night of around 250.000 items. The v5.4.12 seems to have the same issue. So we downgraded to v.5.4.12.

Created at 10 hours ago
started
Created at 10 hours ago
issue comment
[WebProfiler] Time Shift with Clock

@chr-hertel to me, the main issue with using the toolbar is that it does not fit the needs. The toolbar is available after executing the request, while the clock would already have been consumed. So it is too late to adjust it.

Created at 10 hours ago
issue comment
[WebProfiler] Time Shift with Clock

I think it boils down to a couple of more questions than only if the profiler is the right place to do it.

1. Do we want to use the Clock Component to decouple the framework from the system time?

This would require work in a few components, ideally all places where new DateTime[Immutable] is used. At least I would expect the important ones like Serializer, Forms, Validator or HttpFoundation to use that abstraction. If the AboutCommand wouldn't used it, it wouldn't be that tragic, I guess.

If we have a "yes" for the first question, the next one would be:

2. Is the Clock component always installed or an optional requirement?

This would make it more complex to do the implementation across the framework, but still a valid question, I guess.

Regardless of the second one, the last question here would be:

3. Do we want to offer the time shift only via configuration or also via cookie/header/console argument?

I get the reasoning that the profiler collects data of the request and is intended that way, but on the other hand it is the main developer tooling besides the IDE while working with Symfony. Coming from a DX perspective I wouldn't mind the initial intention of the toolbar, but value primarily the feature.

If we answer the first question with a "no", the other two are not longer that interesting, but IMHO I wouldn't see the value in the component than.

Created at 11 hours ago
issue comment
[DependencyInjection] Introduce build parameters

I like this idea too 👍🏼 I proposed that 8 years ago 👼🏼

Created at 11 hours ago
issue comment
[DependencyInjection] Introduce build parameters

The next step will likely be to find a way to help the community move from public params to private ones. Here is an idea: when both 'foo' and '.foo' exist, we could consider that this means that using 'foo' at runtime is deprecated. This might help bundles adopt private params.

And another step could be to find a way to completely deprecate a parameter. An idea: params starting-and-ending with a ~ would mean that: get('foo') would lookup for get('~foo~') and trigger a deprecation. That'd work with private and public params of course.

Before working on this, my intention was to work on deprecating parameters (https://symfony-devs.slack.com/archives/C8WHX21K7/p1663341791619939), so I definitely agree that this should be the next step for another PR :).

Created at 11 hours ago
issue comment
add azerbaijani missing translation

How do you do those translations @lacpandore? We require a review by a native speaker before merging translations. Can you please figure out who would be a native speaker of each language and ask the a review here? I suggest looking at the "blame" of the file to figure this out. Please do that for every language you're contributing.

Created at 11 hours ago
issue comment
add azerbaijani missing translation

It looks like you unchecked the "Allow edits from maintainer" box. That is fine, but please note that if you have multiple commits, you'll need to squash your commits into one before this can be merged. Or, you can check the "Allow edits from maintainers" box and the maintainer can squash for you.

Cheers!

Carsonbot

Created at 12 hours ago