Skip to content

Commit

Permalink
fix: use autowire attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineGonzalez committed Apr 23, 2024
1 parent e63b878 commit 83716f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 0 additions & 4 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,5 @@ services:
- '../src/Entity/'
- '../src/Kernel.php'

App\Service\Mailer:
arguments:
$pdfDirectory: '%app.pdf_directory%'

# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
2 changes: 2 additions & 0 deletions src/Service/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
use App\Entity\Dinosaur;
use App\Entity\User;
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
use Symfony\Component\DependencyInjection\Attribute\Autowire;

final readonly class Mailer
{
public function __construct(
private MailerInterface $mailer,
#[Autowire('%app.pdf_directory%')]
private string $pdfDirectory
) {
}
Expand Down

0 comments on commit 83716f2

Please sign in to comment.