Skip to content

chore(codebase): [di] modernize plugin#159

Merged
Jibbarth merged 8 commits intofeature/upgrade-v2from
chore/modernize-dependency-injection
Apr 28, 2025
Merged

chore(codebase): [di] modernize plugin#159
Jibbarth merged 8 commits intofeature/upgrade-v2from
chore/modernize-dependency-injection

Conversation

@maxperei
Copy link

No description provided.

@maxperei maxperei force-pushed the chore/modernize-dependency-injection branch from 32e2e16 to c42fb78 Compare April 23, 2025 09:24
SymfonySetList::SYMFONY_63,
SymfonySetList::SYMFONY_64,
SymfonySetList::SYMFONY_71,
SymfonySetList::SYMFONY_72,
Copy link
Member

Choose a reason for hiding this comment

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

I think we shouldn't add set lists for sf 7.x, as the minimal version for sylius v2 is 6.4

RelatedPaymentIdProviderInterface $relatedPaymentIdProvider,
TranslatorInterface $translator
private RequestStack $requestStack,
private ObjectRepository $refundPaymentRepository,
Copy link
Member

Choose a reason for hiding this comment

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

can we put at least ResourceRepositoryInterface instead of ObjectRepository ?

* @ORM\OneToMany(targetEntity=Card::class, mappedBy="paymentMethod", orphanRemoval=true)
*/
/** @ORM\OneToMany(targetEntity=Card::class, mappedBy="paymentMethod", orphanRemoval=true) */
#[ORM\OneToMany(targetEntity: Card::class, mappedBy: 'paymentMethod', orphanRemoval: true)]
Copy link
Member

Choose a reason for hiding this comment

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

To keep in mind, but Card may should be a supermappedclass and here we should reference an interface. Let's do that on another PR

}

return false;
return $paymentResource->__isset('authorization') && $paymentResource->__get('authorization') instanceof PaymentAuthorization && null !== $paymentResource->__get('authorization')->__get('expires_at') && $now < $now->setTimestamp($paymentResource->__get('authorization')->__get('expires_at'));
Copy link
Member

Choose a reason for hiding this comment

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

for this one, i prefer the indent in the if. Maybe we can add some newline here


use SyliusPluginTrait;

public const VERSION = '1.11.0';
Copy link
Member

Choose a reason for hiding this comment

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

maybe we can remove this one ? or put 2.0.x-dev

private RefundHistoryRepositoryInterface $payplugRefundHistoryRepository;

private PayPlugApiClientFactoryInterface $apiClientFactory;
public $payPlugApiClient;
Copy link
Member

Choose a reason for hiding this comment

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

can we add the interface here ? Why it is public ?

use Sylius\RefundPlugin\Provider\RefundPaymentMethodsProviderInterface;
use Symfony\Component\DependencyInjection\Attribute\AsDecorator;

#[AsDecorator(ApplePaySupportedRefundPaymentMethodsProviderDecorator::class)]
Copy link
Member

Choose a reason for hiding this comment

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

weird that Amex decorate applePay

use Sylius\RefundPlugin\Provider\RefundPaymentMethodsProviderInterface;
use Symfony\Component\DependencyInjection\Attribute\AsDecorator;

#[AsDecorator(BancontactSupportedRefundPaymentMethodsProviderDecorator::class)]
Copy link
Member

Choose a reason for hiding this comment

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

weird too here

return $this->createQueryBuilder('o')
->where('o.details LIKE :payplugPaymentId')
->setParameter('payplugPaymentId', '%'.$payplugPaymentId.'%')
->setParameter('payplugPaymentId', '%' . $payplugPaymentId . '%')
Copy link
Member

Choose a reason for hiding this comment

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

detail, but i think the % fit better in the where instead the setParameter

@@ -11,28 +11,25 @@

final class GetCurrentRouteExtension extends AbstractExtension
Copy link
Member

Choose a reason for hiding this comment

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

detail, we should remove this and use {{ app.request.get('_route') }}

@maxperei maxperei force-pushed the chore/modernize-dependency-injection branch from 4b8fa41 to 99dd5a3 Compare April 25, 2025 13:38
Copy link
Member

@Jibbarth Jibbarth left a comment

Choose a reason for hiding this comment

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

This PR use huge enough. Let's merge and open new one if necessary

@Jibbarth Jibbarth marked this pull request as ready for review April 28, 2025 08:47
@Jibbarth Jibbarth merged commit d750d04 into feature/upgrade-v2 Apr 28, 2025
0 of 3 checks passed
@Jibbarth Jibbarth deleted the chore/modernize-dependency-injection branch April 28, 2025 13:01
@Jibbarth Jibbarth added the v2 label Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants