Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions app/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,6 @@ services:
$mailchimp: '@app.mailchimp_api'
$listId: "%mailchimp_members_list%"

mailer.adapter.php:
class: AppBundle\Email\Mailer\Adapter\PhpMailerAdapter
factory: [AppBundle\Email\Mailer\Adapter\PhpMailerAdapter, createFromConfiguration]
arguments: ['@Afup\Site\Utils\Configuration']

mailer.adapter.symfony:
class: AppBundle\Email\Mailer\Adapter\SymfonyMailerAdapter
autowire: true
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"league/oauth2-github": "^3.1",
"nyholm/psr7": "^1.8",
"pear/pear": "^1.10",
"phpmailer/phpmailer": "^6.12",
"phpoffice/phpspreadsheet": "^5.7.0",
"pimple/pimple": "^3.6",
"presta/sitemap-bundle": "^4.3",
Expand Down
83 changes: 1 addition & 82 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 0 additions & 48 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -1465,24 +1465,6 @@
'count' => 1,
'path' => __DIR__ . '/sources/Afup/Utils/LegacyConnectionFactory.php',
];
$ignoreErrors[] = [
'message' => '#^Cannot call method getEmail\\(\\) on mixed\\.$#',
'identifier' => 'method.nonObject',
'count' => 1,
'path' => __DIR__ . '/sources/Afup/Utils/Mailing.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$array of function reset expects array\\|object, array\\<AppBundle\\\\Email\\\\Mailer\\\\MailUser\\>\\|null given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/Afup/Utils/Mailing.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#2 \\$replace of function str_replace expects array\\<string\\>\\|string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/Afup/Utils/Mailing.php',
];
$ignoreErrors[] = [
'message' => '#^Binary operation "\\." between mixed and \' \' results in an error\\.$#',
'identifier' => 'binaryOp.invalid',
Expand Down Expand Up @@ -7471,36 +7453,6 @@
'count' => 1,
'path' => __DIR__ . '/sources/AppBundle/Email/Mailer/Adapter/MailerAdapter.php',
];
$ignoreErrors[] = [
'message' => '#^Argument of an invalid type array\\<AppBundle\\\\Email\\\\Mailer\\\\MailUser\\>\\|null supplied for foreach, only iterables are supported\\.$#',
'identifier' => 'foreach.nonIterable',
'count' => 1,
'path' => __DIR__ . '/sources/AppBundle/Email/Mailer/Adapter/PhpMailerAdapter.php',
];
$ignoreErrors[] = [
'message' => '#^Cannot cast mixed to string\\.$#',
'identifier' => 'cast.string',
'count' => 2,
'path' => __DIR__ . '/sources/AppBundle/Email/Mailer/Adapter/PhpMailerAdapter.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$smtpServer of class AppBundle\\\\Email\\\\Mailer\\\\Adapter\\\\PhpMailerAdapter constructor expects string\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/AppBundle/Email/Mailer/Adapter/PhpMailerAdapter.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#3 \\$username of class AppBundle\\\\Email\\\\Mailer\\\\Adapter\\\\PhpMailerAdapter constructor expects string\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/AppBundle/Email/Mailer/Adapter/PhpMailerAdapter.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#4 \\$password of class AppBundle\\\\Email\\\\Mailer\\\\Adapter\\\\PhpMailerAdapter constructor expects string\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/AppBundle/Email/Mailer/Adapter/PhpMailerAdapter.php',
];
$ignoreErrors[] = [
'message' => '#^Argument of an invalid type array\\<AppBundle\\\\Email\\\\Mailer\\\\MailUser\\>\\|null supplied for foreach, only iterables are supported\\.$#',
'identifier' => 'foreach.nonIterable',
Expand Down
27 changes: 0 additions & 27 deletions sources/Afup/Utils/Mail.php

This file was deleted.

22 changes: 0 additions & 22 deletions sources/Afup/Utils/Mailing.php

This file was deleted.

8 changes: 5 additions & 3 deletions sources/AppBundle/Accounting/InvoicingMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace AppBundle\Accounting;

use Afup\Site\Utils\Mailing;
use AppBundle\Afup;
use AppBundle\Accounting\Model\Invoicing;
use AppBundle\Email\Mailer\Attachment;
use AppBundle\Email\Mailer\Mailer;
use AppBundle\Email\Mailer\MailUser;
use AppBundle\Email\Mailer\Message;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
Expand All @@ -16,6 +16,7 @@
{
public function __construct(
private InvoicingPdfGenerator $pdfGenerator,
private Mailer $mailer,
#[Autowire('%kernel.project_dir%/../htdocs/cache/')]
private string $publicCacheDir,
) {}
Expand All @@ -24,7 +25,7 @@ public function sendInvoice(Invoicing $invoicing): bool
{
$invoiceNumber = $invoicing->getInvoiceNumber();

$sujet = "Facture AFUP\n";
$sujet = "Facture AFUP";

$corps = "Bonjour, \n\n";
$corps .= "Veuillez trouver ci-joint la facture correspondant à la participation au forum organisé par l'AFUP.\n";
Expand All @@ -48,7 +49,8 @@ public function sendInvoice(Invoicing $invoicing): bool
'base64',
'application/pdf',
));
$ok = Mailing::envoyerMail($message, $corps);
$message->setContent($corps);
$ok = $this->mailer->send($message);

@unlink($cheminFacture);

Expand Down
90 changes: 0 additions & 90 deletions sources/AppBundle/Email/Mailer/Adapter/PhpMailerAdapter.php

This file was deleted.

Loading