Skip to content
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

review: translation RU #54683

Closed
wants to merge 8,578 commits into from
Closed

review: translation RU #54683

wants to merge 8,578 commits into from

Conversation

HMRDevil
Copy link
Contributor

Q A
Branch? 5.4
Bug fix? no
New feature? no
Deprecations? no
Issues Fix #54560->
License MIT

The translation has been reviewed.

alexandre-daubois and others added 30 commits March 21, 2024 15:40
* 5.4:
  preserve the file modification time when mirroring directories
  use local PHP web server to test HTTP stream wrappers
* 6.4:
  preserve the file modification time when mirroring directories
  use local PHP web server to test HTTP stream wrappers
…in `DOMCaster` (alexandre-daubois)

This PR was merged into the 7.1 branch.

Discussion
----------

[VarDumper] Add support for new DOM extension classes in `DOMCaster`

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Issues        | -
| License       | MIT

Add the new DOM extension classes from PHP 8.4 into DOMCaster, along with "legacy" classes. The "modern" term I'm using in tests in the one used in the different RFCs.

Commits
-------

924d587 [VarDumper] Add support for new DOM extension classes in `DOMCaster`
…iluz)

This PR was merged into the 7.1 branch.

Discussion
----------

[DependencyInjection] Update an error message

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Issues        | -
| License       | MIT

In a Symfony app I had the following:

```php
#[Autowire('%env(kernel.project_dir)%')] private string $projectDir,
```

This should be instead:

```php
#[Autowire('%kernel.project_dir%')] private string $projectDir,
```

In the console I saw this error message:

<img width="822" alt="" src="https://github.com/symfony/symfony/assets/73419/c0303757-36bd-41ab-9ba1-ef912c9740df">

In my opinion, the error is not perfectly clear. That's why in this PR I propose some changes for your consideration. Thanks!

Commits
-------

156e5ba [DependencyInjection] Update an error message
* 7.0:
  preserve the file modification time when mirroring directories
  use local PHP web server to test HTTP stream wrappers
This PR was squashed before being merged into the 7.0 branch.

Discussion
----------

[Yaml] prefix examples with #

| Q             | A
| ------------- | ---
| Branch?       | 7.0
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix ##54154
| License       | MIT

As mentioned in the issue, the yaml before wasn't valid, as the examples were dumped as an array in the yaml.  This simply comments the examples.

Commits
-------

fd95a8f [Yaml] prefix examples with #
…child classes (GromNaN)

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

Discussion
----------

[DependencyInjection] Apply attribute configurator to child classes

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Issues        | Fix #52898
| License       | MIT

This allows extending attribute classes registered for autoconfiguration.

Use-case: Share configuration between several classes with pre-configured attribute classes. As described in #52898 (bus name for `AsMessageHandler`, schedule name for `AsCronTask` and `AsPeriodicTask`)

The child-class attribute is handled by the same function as it's parent class that is registered for autoconfiguration. This means any additional property will be ignored (unless supported, which could be new feature for the `AsTaggedItem` attribute configurator).

If there is a configurator for the child class, the configurator for the parent class is not called.

Commits
-------

69dc71b [DependencyInjection] Apply attribute configurator to child classes
…gn of the workflow profiler panel (javiereguiluz)

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

Discussion
----------

[WebProfilerBundle] [WebProfilerPanel] Update the design of the workflow profiler panel

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Issues        | -
| License       | MIT

The Workflow profiler panel is very nice, but I think it has some design issues, mostly on dark mode. This PR proposes some changes:

| Before | After
| ------ | -----
| ![workflow-profiler-dark-before](https://github.com/symfony/symfony/assets/73419/6420854f-a120-490b-9bd6-6797fb5e4c51) | ![workflow-profiler-dark-after](https://github.com/symfony/symfony/assets/73419/3cbfafa7-9fee-433e-816f-0bba4b6500ba)
| ![workflow-profiler-light-before](https://github.com/symfony/symfony/assets/73419/b374a23e-93a3-45a0-a2eb-edf98781c7de) | ![workflow-profiler-light-after](https://github.com/symfony/symfony/assets/73419/7d651f93-2d34-4676-97d1-bf3e769ef546)

I don't have before/after screenshots, but this PR also fixes the design of the dialog that opens when you click on any node.

-----

There's other obvious issue which is that the SVG diagram overflows the page. I looked into JS libraries such as https://github.com/anvaka/panzoom and https://github.com/bumbu/svg-pan-zoom to add a "pan + zoom" utility ... but for now I think this would be worse. A full-size overflown diagram is more productive to quickly find issues.

Commits
-------

6297faa [WebProfilerBundle] [WebProfilerPanel] Update the design of the workflow profiler panel
…Handler` (GromNaN)

This PR was merged into the 7.1 branch.

Discussion
----------

[Messenger] Allow extending attribute class `AsMessageHandler`

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Issues        | -
| License       | MIT

Revert #52971 which made `AsMessageHandler` final.

Discussed in #54365 (comment)

Commits
-------

9479563 Allow extending AsMessageHandler
…tener attributes (GromNaN)

This PR was merged into the 7.1 branch.

Discussion
----------

[FrameworkBundle] Remove custom handler for Workflow listener attributes

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

All the `Workflow\Attribute\As*Listener` classes extend `AsEventListener`. Since the attribute handler are now applied to child classes (#54365), it's no longer necessary to declare an attribute handler for each attribute.

Discussed in #54365 (comment)

Commits
-------

db7004c Remove custom handler for Workflow listener attributes
This PR was merged into the 7.1 branch.

Discussion
----------

[DependencyInjection]  fix test

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        |
| License       | MIT

Commits
-------

df97b92 fix test
…latable enum (IndraGunawan)

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

Discussion
----------

[Serializer] Fixed BackedEnumNormalizer priority for translatable enum

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        |
| License       | MIT

```php
enum MyEnum: string implements TranslatableInterface
{
    case Get = 'GET';
    case Post = 'POST';
    case Update = 'UPDATE';

    public function trans(TranslatorInterface $translator, ?string $locale = null): string
    {
        return match ($this) {
            self::Get  => 'custom_get',
            self::Post  => 'custom_post',
            self::Update => 'custom_update'
        };
    }
}
```

```php
class MyController {
    public function __invoke(SerializerInterface $serializer) {
        dd($serializer->serialize(MyEnum::Get)); // ""custom_get"" , Expected result: ""GET""
    }
}
```

serialize a BackedEnum that implements `TranslatableInterface` will return the translation value instead of the enum item value. this is because `TranslatableNormalizer` ([ref](https://github.com/symfony/symfony/blob/7.1/src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.php#L116-L118)) has higher priority than `BackedEnumNormalizer`

this PR changes the `BackedEnumNormalizer` priority higher than  `TranslatableNormalizer` priority

Commits
-------

42fde94 [Serializer] Fixed BackedEnumNormalizer priority for translatable enum
This PR was merged into the 7.1 branch.

Discussion
----------

[HttpFoundation] fix UriSigner tests

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        |
| License       | MIT

Commits
-------

868fe0a fix UriSigner tests
This PR was merged into the 7.1 branch.

Discussion
----------

[Filesystem]  fix tests on Windows

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        |
| License       | MIT

Commits
-------

3dc9c4e fix tests on Windows
…-daubois)

This PR was merged into the 7.1 branch.

Discussion
----------

[TypeInfo] Fix missing explicit nullable type

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

Commits
-------

82cbc95 [TypeInfo] Fix missing explicit nullable type
nicolas-grekas and others added 20 commits April 18, 2024 11:22
* 5.4:
  Auto-close PRs on subtree-splits
  review German translation
* 6.4:
  Auto-close PRs on subtree-splits
  review German translation
* 7.0:
  Auto-close PRs on subtree-splits
  review German translation
…ubclasses (xabbuh)

This PR was merged into the 7.1 branch.

Discussion
----------

[TypeInfo] rework the base Type class to not depend on subclasses

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        |
| License       | MIT

Commits
-------

3738245 rework the base Type class to not depend on subclasses
…r::withDefaultContructorArguments() (javaDeveloperKid)

This PR was merged into the 7.1 branch.

Discussion
----------

[Serializer] fix typo in AbstractNormalizerContextBuilder::withDefaultContructorArguments()

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Issues        | Closes #54616
| License       | MIT

This is not a bug in the meaning of a bug so no need to fix this on 6.4. However a deprecation is needed.

Commits
-------

26b9d6a fix typo in AbstractNormalizerContextBuilder::withDefaultContructorArguments()
Signed-off-by: Rene Lima <renedelima@gmail.com>
… argument attribute (renedelima)

This PR was merged into the 7.1 branch.

Discussion
----------

[HttpKernel] Introduce `#[MapUploadedFile]` controller argument attribute

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | #52678, #49138
| License       | MIT
| Doc PR        | -

## Usage Example

```php
# src/Controller/UserPictureController.php

namespace App\Controller;

use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Attribute\AsController;
use Symfony\Component\HttpKernel\Attribute\MapUploadedFile;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Validator\Constraints as Assert;

#[AsController]
final class UserPictureController
{
    #[Route('/user/picture', methods: ['PUT'])]
    public function __invoke(
        #[MapUploadedFile(
            new Assert\File(mimeTypes: ['image/png', 'image/jpeg']),
        )] ?UploadedFile $picture,
    ): Response {
        return new Response('Your picture was updated');
    }
}
```

```php
# src/Controller/UserDocumentsController.php

namespace App\Controller;

use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Attribute\AsController;
use Symfony\Component\HttpKernel\Attribute\MapUploadedFile;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Validator\Constraints as Assert;

final class UserDocumentsController
{
    #[Route('/user/documents', methods: ['PUT'])]
    public function __invoke(
        #[MapUploadedFile(
            new Assert\File(mimeTypes: ['application/pdf'])
        )] array $documents
    ): Response {
        return new Response('Thanks for sharing your documents');
    }
}
```

```php
# src/Controller/UserDocumentsController.php

namespace App\Controller;

use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Attribute\AsController;
use Symfony\Component\HttpKernel\Attribute\MapUploadedFile;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Validator\Constraints as Assert;

final class UserDocumentsController
{
    #[Route('/user/documents', methods: ['PUT'])]
    public function __invoke(
        #[MapUploadedFile(
            new Assert\File(mimeTypes: ['application/pdf'])
        )] UploadedFile ...$documents
    ): Response {
        return new Response('Thanks for sharing your documents');
    }
}
```

Commits
-------

b85dbd0 [HttpKernel] Add MapUploadedFile attribute
A new test was added to AccessTokenAuthenticatorTest to ensure that the regular expression in HeaderAccessTokenExtractor works correctly. The regular expression was tweaked to support a wider range of tokens, especially those ending with an equals sign.
This PR was merged into the 6.4 branch.

Discussion
----------

Add test for AccessTokenHeaderRegex and adjust regex

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Issues        | Fix #54660
| License       | MIT

The regular expression was tweaked to support a wider range of tokens, especially those ending with an equals sign and fulfil with the [RFC6750](https://datatracker.ietf.org/doc/html/rfc6750#section-2.1).
A new test was added to AccessTokenAuthenticatorTest to ensure that the regular expression in HeaderAccessTokenExtractor works correctly.

Commits
-------

0843389 Add test for AccessTokenHeaderRegex and adjust regex
…entInterface decorators (yann-eugone)

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

Discussion
----------

[HttpClient] Implemented LoggerAwareInterface in HttpClientInterface decorators

Implement `Psr\Log\LoggerAwareInterface` in `Symfony\Component\HttpClient\UriTemplateHttpClient`.

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        |
| License       | MIT

I was on a journey to enhance our logs on a project that highly depend on `HttpClient`.
I started to separate logs per feature, and I wanted to include `HttpClient` logs to the logger of the currently running the feature.

I figured out that most implementations of `HttpClientInterface` are implementing `LoggerAwareInterface`, so I decided to just call `$client->setLogger(...)` on my side.
And **nothing changed**.

Nothing changed because my logger is decorated by the `UriTemplateHttpClient` that is not implementing `LoggerAwareInterface`.
Althought `UriTemplateHttpClient` has no need of a logger, as a decorator it should be able to act like it, so the underlying client can be reached.
This is what is done for instance in `Symfony\Component\HttpClient\TraceableHttpClient`.

Commits
-------

c2a7b73 [HttpClient] Implemented LoggerAwareInterface in HttpClientInterface decorators
* 6.4:
  fix merge
  Add test for AccessTokenHeaderRegex and adjust regex
* 7.0:
  fix merge
  Add test for AccessTokenHeaderRegex and adjust regex
@carsonbot carsonbot added this to the 5.4 milestone Apr 20, 2024
@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.1 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@HMRDevil HMRDevil closed this by deleting the head repository Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet