Skip to content

Use #[Autowire] attribute in FileUploader service example #20914

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 2,612 commits into
base: 6.4
Choose a base branch
from

Conversation

foybkaa
Copy link

@foybkaa foybkaa commented Apr 24, 2025

Replaced the YAML-based injection of the uploads_directory parameter with the #[Autowire] attribute directly in the FileUploader constructor. This avoids service configuration issues and ensures the example works out of the box with modern Symfony versions.

TimoBakx and others added 30 commits December 7, 2024 12:19
This PR was merged into the 7.2 branch.

Discussion
----------

Replaced `caution` directive by `warning`

Fixes symfony#20371

Commits
-------

0a3fb8d Replaced `caution` directive by `warning`
…nverterInterface (mttsch)

This PR was merged into the 7.1 branch.

Discussion
----------

[Serializer] Add class/format/context to NameConverterInterface

Fix symfony#19683

<!--

If your pull request fixes a BUG, use the oldest maintained branch that contains
the bug (see https://symfony.com/releases 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 `7.x` for features of unreleased versions).

-->

Commits
-------

b53029a [Serializer] Add class/format/context to NameConverterInterface
…olas Appriou)

This PR was submitted for the 6.3 branch but it was merged into the 7.1 branch instead.

Discussion
----------

42948 reduce response contraints verbosity

Link the issue [#49184](symfony/symfony#49184), and [PR](symfony/symfony#49184).

Update signature of HTTP response constraints.

Commits
-------

d159a4a [HttpFoundation] Update http response test constraint signature
* 6.4:
  [symfony#19940] Use specialized directive
  Add more necessary information
  Update calling_commands.rst - call the command non interactively
  add symfonycasts links in frontend doc
* 7.1:
  [symfony#19940] Use specialized directive
  Add more necessary information
  Update calling_commands.rst - call the command non interactively
  [HttpFoundation] Update http response test constraint signature
  add symfonycasts links in frontend doc
  [Serializer] Add class/format/context to NameConverterInterface
* 6.4:
  Added replacement suggestions for forbidden directives
* 7.1:
  Added replacement suggestions for forbidden directives
* 6.4:
  Remove obsolete whitelist entry
* 7.1:
  Remove obsolete whitelist entry
* 6.4:
  Add missing argument
  [Mesenger] Mention that some option doesn't have docs
* 7.1:
  Add missing argument
  [Mesenger] Mention that some option doesn't have docs
* 7.1:
  Minor tweaks
  [Scheduler] Add some pointers regarding worker processes deployment
* 6.4:
  Minor tweaks
  [Scheduler] Add some pointers regarding worker processes deployment
* 7.1:
  Update controller.rst
* 6.4:
  Update controller.rst
…tion (Korbeil)

This PR was merged into the 7.2 branch.

Discussion
----------

[TypeInfo] Add more details to TypeInfo documentation

This pull request is to revamp current TypeInfo documentation.
I tried to make the most of the recent changes while answering `@javiereguiluz`'s issue (thanks to "PHPDoc parsing" part).

It should fixes symfony#20389, symfony#20064 and symfony#20014.

Commits
-------

dc999f3 Add more details to TypeInfo documentation
* 6.4:
  Minor tweaks
  Add few doc on marshaller in redis adapter
* 7.1:
  Minor tweaks
  Add few doc on marshaller in redis adapter
* 6.4:
  [Twig] [Twig Reference] fix path parameter and add example in asset v…
  Update serializer.rst
* 7.1:
  [Twig] [Twig Reference] fix path parameter and add example in asset v…
  Update serializer.rst
…bbuh)

This PR was merged into the 7.1 branch.

Discussion
----------

use ? before nullable single type declaration

see https://github.com/symfony/symfony-docs/actions/runs/12357370718/job/34485453495

Commits
-------

b0f09c6 use ? before nullable single type declaration
* 7.1:
  use ? before nullable single type declaration
…word strength estimator (stof)

This PR was merged into the 7.2 branch.

Discussion
----------

[Validator] Fix the configuration for custom password strength estimator

Fixes symfony/symfony#59235

`service_closure` is about building an argument being a closure **returning** that service. This is not what we need for the custom estimator, where we need to inject the estimator callable.

Commits
-------

8aeceab Fix the configuration for custom password strength estimator
javiereguiluz and others added 23 commits April 3, 2025 10:41
* 6.4:
  Minor tweaks
  [Twig] [twig reference] add examples to functions and filter
* 6.4:
  Tweaks and rewords
  [Twig] [twig reference] add examples to functions (format_file, file_…
* 6.4:
  Fix some syntax issues
* 6.4:
  Reword
  [Scheduler] Periodical triggers timing
* 6.4:
  Reword
  [Mailer] Update mailer.rst
* 6.4:
  Fix RST syntax issue
* 6.4:
  Minor reword
  fix command explanation
This PR was submitted for the 7.3 branch but it was merged into the 7.2 branch instead.

Discussion
----------

[Scheduler][Webhook] add screencast links

I'm of course biased but I think these short screencasts do a good job of showing the basics.

**Webhook**: shows installing, configuring an email remote event parser, and creating a consumer.

**Scheduler**: shows installing, creating, adding tasks, running the schedule.

Commits
-------

a7a6c1d [Scheduler][Webhook] add screencast links
* 6.4:
  Minor tweak
  Franken PHP can perform some action after the response has been streamed to the user
* 6.4:
  Tweaks
  [Serializer] (re)document PRESERVE_EMPTY_OBJECTS
* 6.4:
  Update end_to_end.rst
* 6.4:
  Minor tweaks
  [Deployment] - More accurate local .env file recommendation
* 6.4:
  [HttpFoundation] Add FrankenPHP docs for X-Sendfile
* 6.4:
  Update the links related to X-Sendfile and X-Accel-Redirect
  Update the build script to mention that it does not support Windows
* 6.4:
  Fix a syntax issue in Coding Standards
* 6.4:
  Minor tweak
  feat: swap from event constant to event class
* 6.4:
  Update embedded.rst
* 6.4:
  Update routing.rst
* 6.4:
  [EventDispatcher] Fix a minor syntax issue in a reference
* 6.4:
  [Console] Minor tweak in the article introduction
* 6.4:
  Tweaks
  [uid] Fix Uuid::v8() usage example to show it requires a UUID string
  fix(doctrine): default configuration
Replaced the YAML-based injection of the uploads_directory parameter with the #[Autowire] attribute directly in the FileUploader constructor. This avoids service configuration issues and ensures the example works out of the box with modern Symfony versions.
foybkaa and others added 2 commits April 24, 2025 16:55
Co-authored-by: Oskar Stark <oskarstark@googlemail.com>
@@ -240,7 +240,8 @@ logic to a separate service::
class FileUploader
{
public function __construct(
#[Autowire('%brochures_directory%')] private string $targetDirectory,
#[Autowire('%brochures_directory%')]
private string $targetDirectory,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation looks wrong

@foybkaa foybkaa changed the base branch from 7.2 to 6.4 May 2, 2025 07:59
@foybkaa foybkaa requested a review from xabbuh as a code owner May 2, 2025 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment