Skip to content

Commit 76f452f

Browse files
authored
Use #[Autowire] attribute in FileUploader service example
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.
1 parent 46cc24b commit 76f452f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controller/upload_file.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ logic to a separate service::
240240
class FileUploader
241241
{
242242
public function __construct(
243-
private string $targetDirectory,
243+
#[Autowire('%brochures_directory%')] private string $targetDirectory,
244244
private SluggerInterface $slugger,
245245
) {
246246
}

0 commit comments

Comments
 (0)