Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
stakovicz committed Feb 19, 2025
1 parent 35851a7 commit d47f441
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 18 deletions.
34 changes: 26 additions & 8 deletions app/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,21 @@ services:

AppBundle\Command\UpdateMailchimpMembersCommand:
arguments:
- '@Mailchimp\Mailchimp'
- '@AppBundle\Mailchimp\Mailchimp'
- '@CCMBenchmark\TingBundle\Repository\RepositoryFactory'
- "%mailchimp_members_list%"

AppBundle\Command\SynchTechLetterCommand:
arguments:
- '@AppBundle\TechLetter\MailchimpSynchronizer'
- '@Psr\Log\LoggerInterface'


AppBundle\Command\SynchMembersCommand:
arguments:
- '@AppBundle\Mailchimp\MailchimpMembersAutoListSynchronizer'
- '@Psr\Log\LoggerInterface'

AppBundle\Controller\:
resource: '../../sources/AppBundle/Controller/*'
autowire: true
Expand Down Expand Up @@ -353,14 +364,21 @@ services:
class: AppBundle\Mailchimp\Mailchimp
arguments: ["@app.mailchimp_techletter_client"]

# Ne pas utiliser le nom de la classe pour le service car elle est déjà utilisé pour un autre service.
app.techletter_mailchimp_synchronizer:
class: AppBundle\TechLetter\MailchimpSynchronizer
arguments: ["@app.mailchimp_techletter_api", '@AppBundle\Association\Model\Repository\TechletterSubscriptionsRepository', "%mailchimp_techletter_list%"]
AppBundle\TechLetter\MailchimpSynchronizer:
autowire: true
autoconfigure: true
arguments:
- "@app.mailchimp_techletter_api"
- '@AppBundle\Association\Model\Repository\TechletterSubscriptionsRepository'
- "%mailchimp_techletter_list%"

app.mailchimp_members_auto_synchronizer:
class: AppBundle\Mailchimp\MailchimpMembersAutoListSynchronizer
arguments: ['@AppBundle\Mailchimp\Mailchimp', '@AppBundle\Association\Model\Repository\UserRepository', "%mailchimp_members_list%"]
AppBundle\Mailchimp\MailchimpMembersAutoListSynchronizer:
autowire: true
autoconfigure: true
arguments:
- '@app.mailchimp_techletter_api'
- '@AppBundle\Association\Model\Repository\UserRepository'
- "%mailchimp_members_list%"

Afup\Site\Utils\Configuration:
autowire: true
Expand Down
4 changes: 1 addition & 3 deletions sources/AppBundle/Association/Event/NewMemberEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
namespace AppBundle\Association\Event;

use AppBundle\Association\Model\User;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;

class NewMemberEvent extends Event
{
const NAME = 'member.new';

private User $user;

public function __construct(User $user)
Expand Down
4 changes: 1 addition & 3 deletions sources/AppBundle/Association/Event/UserDisabledEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
namespace AppBundle\Association\Event;

use AppBundle\Association\Model\User;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;

class UserDisabledEvent extends Event
{
const NAME = 'user.disabled';

private User $user;

public function __construct(User $user)
Expand Down
5 changes: 1 addition & 4 deletions sources/AppBundle/TechLetter/MailchimpSynchronizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ class MailchimpSynchronizer

private string $listId;

/**
* @var LoggerInterface
*/
private $logger;
private LoggerInterface $logger;

public function __construct(Mailchimp $mailchimp, TechletterSubscriptionsRepository $subscriptionsRepository, string $listId)
{
Expand Down

0 comments on commit d47f441

Please sign in to comment.