Skip to content

Unnest NewPaymentMethodTypeVoter #2787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 13, 2025
Merged

Conversation

adriendupuis
Copy link
Contributor

@adriendupuis adriendupuis commented Jun 11, 2025

Question Answer
JIRA Ticket
Versions
Edition
  • …/src/src/… → …/src/…
  • EOL@EOF

Checklist

  • Text renders correctly
  • Text has been checked with vale
  • Description metadata is up to date
  • Redirects cover removed/moved pages
  • Code samples are working
  • PHP code samples have been fixed with PHP CS fixer
  • Added link to this PR in relevant JIRA ticket or code PR

@adriendupuis adriendupuis force-pushed the fix-NewPaymentMethodTypeVoter branch from 554d43e to 03e017a Compare June 11, 2025 15:14
@adriendupuis adriendupuis marked this pull request as ready for review June 11, 2025 15:16
Copy link

Preview of modified files

Preview of modified Markdown:

Copy link
Contributor

@mnocon mnocon left a comment

Choose a reason for hiding this comment

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

@adriendupuis
Copy link
Contributor Author

It's in lib/lib now 🙈

https://github.com/ibexa/documentation-developer/blob/03e017a4d67c2676e4526ce7d1e25388fcf98a4d/code_samples/front/shop/payment/src/lib/lib/PaymentMethod/Voter/NewPaymentMethodTypeVoter.php

Git can have a strange way to interpret the destination:

% git mv code_samples/front/shop/payment/src/lib/lib code_samples/front/shop/payment/src/lib    
fatal: can not move directory into itself, source=code_samples/front/shop/payment/src/lib/lib, destination=code_samples/front/shop/payment/src/lib/lib
% git mv code_samples/front/shop/payment/src/lib/lib/PaymentMethod code_samples/front/shop/payment/src/lib/PaymentMethod

Fixed…

Copy link

code_samples/ change report

Before (on target branch)After (in current PR)

code_samples/front/shop/payment/src/lib/PaymentMethod/Voter/NewPaymentMethodTypeVoter.php


code_samples/front/shop/payment/src/lib/PaymentMethod/Voter/NewPaymentMethodTypeVoter.php


code_samples/front/shop/payment/src/src/lib/PaymentMethod/Voter/NewPaymentMethodTypeVoter.php

docs/commerce/payment/payment_method_filtering.md@34:``` php
docs/commerce/payment/payment_method_filtering.md@34:``` php
docs/commerce/payment/payment_method_filtering.md@35:[[= include_file('code_samples/front/shop/payment/src/src/lib/PaymentMethod/Voter/NewPaymentMethodTypeVoter.php') =]]
docs/commerce/payment/payment_method_filtering.md@35:[[= include_file('code_samples/front/shop/payment/src/lib/PaymentMethod/Voter/NewPaymentMethodTypeVoter.php') =]]
docs/commerce/payment/payment_method_filtering.md@36:```

001⫶<?php
002⫶
003⫶declare(strict_types=1);
004⫶
005⫶namespace App\Payment\PaymentMethod\Voter;
006⫶
007⫶use Ibexa\Contracts\Cart\Value\CartInterface;
008⫶use Ibexa\Contracts\Payment\PaymentMethod\PaymentMethodInterface;
009⫶use Ibexa\Contracts\Payment\PaymentMethod\Voter\AbstractVoter;
010⫶
011⫶final class NewPaymentMethodTypeVoter extends AbstractVoter
012⫶{
013⫶ protected function getVote(PaymentMethodInterface $method, CartInterface $cart): bool
014⫶ {
015⫶ // Add custom logic if method should not always be visible
016⫶
017⫶ return true;
018⫶ }
019⫶}

docs/commerce/payment/payment_method_filtering.md@36:```

001⫶<?php
002⫶
003⫶declare(strict_types=1);
004⫶
005⫶namespace App\Payment\PaymentMethod\Voter;
006⫶
007⫶use Ibexa\Contracts\Cart\Value\CartInterface;
008⫶use Ibexa\Contracts\Payment\PaymentMethod\PaymentMethodInterface;
009⫶use Ibexa\Contracts\Payment\PaymentMethod\Voter\AbstractVoter;
010⫶
011⫶final class NewPaymentMethodTypeVoter extends AbstractVoter
012⫶{
013⫶ protected function getVote(PaymentMethodInterface $method, CartInterface $cart): bool
014⫶ {
015⫶ // Add custom logic if method should not always be visible
016⫶
017⫶ return true;
018⫶ }
019⫶}


code_samples/front/shop/payment/src/src/lib/PaymentMethod/Voter/NewPaymentMethodTypeVoter.php

Download colorized diff

@adriendupuis adriendupuis requested a review from mnocon June 12, 2025 11:20
@adriendupuis adriendupuis merged commit f3a09aa into 4.6 Jun 13, 2025
8 checks passed
@adriendupuis adriendupuis deleted the fix-NewPaymentMethodTypeVoter branch June 13, 2025 07:00
adriendupuis added a commit that referenced this pull request Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants