Skip to content

Commit

Permalink
minor #326 Do not require visibility in PHPSpec functions (GSadee)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.0-dev branch.

Discussion
----------

Similar explanation as in Sylius/InvoicingPlugin#232

Commits
-------

0a8b271 Do not require visibility in PHPSpec functions
  • Loading branch information
GSadee authored Jul 19, 2021
2 parents f3b1731 + 0a8b271 commit a0d4955
Show file tree
Hide file tree
Showing 67 changed files with 278 additions and 276 deletions.
2 changes: 2 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer;
use PhpCsFixer\Fixer\Comment\HeaderCommentFixer;
use SlevomatCodingStandard\Sniffs\Commenting\InlineDocCommentDeclarationSniff;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
Expand All @@ -21,6 +22,7 @@
]]);

$containerConfigurator->parameters()->set(Option::SKIP, [
VisibilityRequiredFixer::class => ['*Spec.php'],
InlineDocCommentDeclarationSniff::class . '.MissingVariable',
'**/var/*',
]);
Expand Down
8 changes: 4 additions & 4 deletions spec/Calculator/UnitRefundTotalCalculatorSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@

final class UnitRefundTotalCalculatorSpec extends ObjectBehavior
{
public function let(RemainingTotalProviderInterface $remainingTotalProvider): void
function let(RemainingTotalProviderInterface $remainingTotalProvider): void
{
$this->beConstructedWith($remainingTotalProvider);
}

public function it_implements_unit_refund_total_calculator_interface(): void
function it_implements_unit_refund_total_calculator_interface(): void
{
$this->shouldImplement(UnitRefundTotalCalculatorInterface::class);
}

public function it_provides_remaining_total_if_full_refund_option_is_chosen(
function it_provides_remaining_total_if_full_refund_option_is_chosen(
RemainingTotalProviderInterface $remainingTotalProvider
): void {
$refundType = RefundType::shipment();
Expand All @@ -43,7 +43,7 @@ public function it_provides_remaining_total_if_full_refund_option_is_chosen(
;
}

public function it_provides_specified_amount_as_an_integer(): void
function it_provides_specified_amount_as_an_integer(): void
{
$this
->calculateForUnitWithIdAndType(100, RefundType::shipment(), 30.40)
Expand Down
10 changes: 5 additions & 5 deletions spec/Checker/CreditMemoCustomerRelationCheckerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@

final class CreditMemoCustomerRelationCheckerSpec extends ObjectBehavior
{
public function let(
function let(
CustomerContextInterface $customerContext,
RepositoryInterface $creditMemoRepository
): void {
$this->beConstructedWith($customerContext, $creditMemoRepository);
}

public function it_is_initializable(): void
function it_is_initializable(): void
{
$this->shouldHaveType(CreditMemoCustomerRelationChecker::class);
}

public function it_implements_credit_memo_customer_relation_checker_interface(): void
function it_implements_credit_memo_customer_relation_checker_interface(): void
{
$this->shouldImplement(CreditMemoCustomerRelationCheckerInterface::class);
}

public function it_checks_if_customer_id_from_order_is_equal_to_customer_id_from_customer_context(
function it_checks_if_customer_id_from_order_is_equal_to_customer_id_from_customer_context(
CustomerContextInterface $customerContext,
RepositoryInterface $creditMemoRepository,
CreditMemo $creditMemo,
Expand All @@ -61,7 +61,7 @@ public function it_checks_if_customer_id_from_order_is_equal_to_customer_id_from
$this->check('00001');
}

public function it_throws_exception_if_customer_id_from_order_is_not_equal_to_id_from_context(
function it_throws_exception_if_customer_id_from_order_is_not_equal_to_id_from_context(
CustomerContextInterface $customerContext,
RepositoryInterface $creditMemoRepository,
CreditMemo $creditMemo,
Expand Down
10 changes: 5 additions & 5 deletions spec/Checker/OrderFullyRefundedTotalCheckerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@

final class OrderFullyRefundedTotalCheckerSpec extends ObjectBehavior
{
public function let(OrderRefundedTotalProviderInterface $orderRefundedTotalProvider): void
function let(OrderRefundedTotalProviderInterface $orderRefundedTotalProvider): void
{
$this->beConstructedWith($orderRefundedTotalProvider);
}

public function it_is_initializable(): void
function it_is_initializable(): void
{
$this->shouldHaveType(OrderFullyRefundedTotalChecker::class);
}

public function it_implements_order_fully_refunded_total_checker_interface(): void
function it_implements_order_fully_refunded_total_checker_interface(): void
{
$this->shouldImplement(OrderFullyRefundedTotalCheckerInterface::class);
}

public function it_returns_false_if_order_refunded_total_is_lower_than_order_total(
function it_returns_false_if_order_refunded_total_is_lower_than_order_total(
OrderInterface $order,
OrderRefundedTotalProviderInterface $orderRefundedTotalProvider
): void {
Expand All @@ -47,7 +47,7 @@ public function it_returns_false_if_order_refunded_total_is_lower_than_order_tot
$this->isOrderFullyRefunded($order)->shouldReturn(false);
}

public function it_returns_true_if_order_refunded_total_is_equal_to_order_total(
function it_returns_true_if_order_refunded_total_is_equal_to_order_total(
OrderInterface $order,
OrderRefundedTotalProviderInterface $orderRefundedTotalProvider
): void {
Expand Down
16 changes: 8 additions & 8 deletions spec/Checker/OrderRefundingAvailabilityCheckerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@

final class OrderRefundingAvailabilityCheckerSpec extends ObjectBehavior
{
public function let(OrderRepositoryInterface $orderRepository): void
function let(OrderRepositoryInterface $orderRepository): void
{
$this->beConstructedWith($orderRepository);
}

public function it_implements_order_refunding_availability_checker_interface(): void
function it_implements_order_refunding_availability_checker_interface(): void
{
$this->shouldImplement(OrderRefundingAvailabilityCheckerInterface::class);
}

public function it_returns_true_if_order_is_paid_and_not_free(
function it_returns_true_if_order_is_paid_and_not_free(
OrderRepositoryInterface $orderRepository,
OrderInterface $order
): void {
Expand All @@ -42,7 +42,7 @@ public function it_returns_true_if_order_is_paid_and_not_free(
$this('00000007')->shouldReturn(true);
}

public function it_returns_true_if_order_is_partially_refunded_and_not_free(
function it_returns_true_if_order_is_partially_refunded_and_not_free(
OrderRepositoryInterface $orderRepository,
OrderInterface $order
): void {
Expand All @@ -53,7 +53,7 @@ public function it_returns_true_if_order_is_partially_refunded_and_not_free(
$this('00000007')->shouldReturn(true);
}

public function it_returns_false_if_order_is_in_other_state_and_not_free(
function it_returns_false_if_order_is_in_other_state_and_not_free(
OrderRepositoryInterface $orderRepository,
OrderInterface $order
): void {
Expand All @@ -64,7 +64,7 @@ public function it_returns_false_if_order_is_in_other_state_and_not_free(
$this('00000007')->shouldReturn(false);
}

public function it_returns_false_if_order_is_free(
function it_returns_false_if_order_is_free(
OrderRepositoryInterface $orderRepository,
OrderInterface $order
): void {
Expand All @@ -75,7 +75,7 @@ public function it_returns_false_if_order_is_free(
$this('00000007')->shouldReturn(false);
}

public function it_returns_false_if_order_is_partially_refunded_and_free(
function it_returns_false_if_order_is_partially_refunded_and_free(
OrderRepositoryInterface $orderRepository,
OrderInterface $order
): void {
Expand All @@ -86,7 +86,7 @@ public function it_returns_false_if_order_is_partially_refunded_and_free(
$this('00000007')->shouldReturn(false);
}

public function it_returns_false_if_order_is_in_other_state_and_free(
function it_returns_false_if_order_is_in_other_state_and_free(
OrderRepositoryInterface $orderRepository,
OrderInterface $order
): void {
Expand Down
18 changes: 9 additions & 9 deletions spec/Checker/OrderRefundsListAvailabilityCheckerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@

final class OrderRefundsListAvailabilityCheckerSpec extends ObjectBehavior
{
public function let(OrderRepositoryInterface $orderRepository): void
function let(OrderRepositoryInterface $orderRepository): void
{
$this->beConstructedWith($orderRepository);
}

public function it_implements_order_refunding_availability_checker_interface(): void
function it_implements_order_refunding_availability_checker_interface(): void
{
$this->shouldImplement(OrderRefundingAvailabilityCheckerInterface::class);
}

public function it_returns_true_if_order_is_paid_and_not_free(
function it_returns_true_if_order_is_paid_and_not_free(
OrderRepositoryInterface $orderRepository,
OrderInterface $order
): void {
Expand All @@ -42,7 +42,7 @@ public function it_returns_true_if_order_is_paid_and_not_free(
$this('00000007')->shouldReturn(true);
}

public function it_returns_true_if_order_is_refunded_and_not_free(
function it_returns_true_if_order_is_refunded_and_not_free(
OrderRepositoryInterface $orderRepository,
OrderInterface $order
): void {
Expand All @@ -53,7 +53,7 @@ public function it_returns_true_if_order_is_refunded_and_not_free(
$this('00000007')->shouldReturn(true);
}

public function it_returns_true_if_order_is_partially_refunded_and_not_free(
function it_returns_true_if_order_is_partially_refunded_and_not_free(
OrderRepositoryInterface $orderRepository,
OrderInterface $order
): void {
Expand All @@ -64,7 +64,7 @@ public function it_returns_true_if_order_is_partially_refunded_and_not_free(
$this('00000007')->shouldReturn(true);
}

public function it_returns_false_if_order_is_in_other_state_and_not_free(
function it_returns_false_if_order_is_in_other_state_and_not_free(
OrderRepositoryInterface $orderRepository,
OrderInterface $order
): void {
Expand All @@ -75,7 +75,7 @@ public function it_returns_false_if_order_is_in_other_state_and_not_free(
$this('00000007')->shouldReturn(false);
}

public function it_returns_false_if_order_is_paid_and_free(
function it_returns_false_if_order_is_paid_and_free(
OrderRepositoryInterface $orderRepository,
OrderInterface $order
): void {
Expand All @@ -86,7 +86,7 @@ public function it_returns_false_if_order_is_paid_and_free(
$this('00000007')->shouldReturn(false);
}

public function it_returns_false_if_order_is_refunded_and_free(
function it_returns_false_if_order_is_refunded_and_free(
OrderRepositoryInterface $orderRepository,
OrderInterface $order
): void {
Expand All @@ -97,7 +97,7 @@ public function it_returns_false_if_order_is_refunded_and_free(
$this('00000007')->shouldReturn(false);
}

public function it_returns_false_if_order_is_in_other_state_and_free(
function it_returns_false_if_order_is_in_other_state_and_free(
OrderRepositoryInterface $orderRepository,
OrderInterface $order
): void {
Expand Down
8 changes: 4 additions & 4 deletions spec/Checker/UnitRefundingAvailabilityCheckerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@

final class UnitRefundingAvailabilityCheckerSpec extends ObjectBehavior
{
public function let(
function let(
RemainingTotalProviderInterface $remainingTotalProvider
): void {
$this->beConstructedWith($remainingTotalProvider);
}

public function it_implements_unit_refunding_availability_checker_interface(): void
function it_implements_unit_refunding_availability_checker_interface(): void
{
$this->shouldImplement(UnitRefundingAvailabilityCheckerInterface::class);
}

public function it_returns_false_if_remaining_unit_total_is_0(
function it_returns_false_if_remaining_unit_total_is_0(
RemainingTotalProviderInterface $remainingTotalProvider
): void {
$type = RefundType::orderItemUnit();
Expand All @@ -41,7 +41,7 @@ public function it_returns_false_if_remaining_unit_total_is_0(
$this->__invoke(1, $type)->shouldReturn(false);
}

public function it_returns_true_if_remaining_unit_total_is_more_than_0(
function it_returns_true_if_remaining_unit_total_is_more_than_0(
RemainingTotalProviderInterface $remainingTotalProvider
): void {
$type = RefundType::shipment();
Expand Down
2 changes: 1 addition & 1 deletion spec/Command/GenerateCreditMemoSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

final class GenerateCreditMemoSpec extends ObjectBehavior
{
public function it_represents_an_intention_to_generate_credit_memo(): void
function it_represents_an_intention_to_generate_credit_memo(): void
{
$unitRefunds = [new OrderItemUnitRefund(1, 1000), new OrderItemUnitRefund(3, 2000), new OrderItemUnitRefund(5, 3000)];
$shipmentRefunds = [new ShipmentRefund(1, 1000)];
Expand Down
2 changes: 1 addition & 1 deletion spec/Command/RefundUnitsSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

final class RefundUnitsSpec extends ObjectBehavior
{
public function it_represents_an_intention_to_refund_specific_order_units_and_shipments(): void
function it_represents_an_intention_to_refund_specific_order_units_and_shipments(): void
{
$unitRefunds = [new OrderItemUnitRefund(1, 1000), new OrderItemUnitRefund(3, 2000), new OrderItemUnitRefund(5, 3000)];
$shipmentRefunds = [new ShipmentRefund(1, 1000)];
Expand Down
4 changes: 2 additions & 2 deletions spec/CommandHandler/GenerateCreditMemoHandlerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

final class GenerateCreditMemoHandlerSpec extends ObjectBehavior
{
public function let(
function let(
CreditMemoGeneratorInterface $creditMemoGenerator,
ObjectManager $creditMemoManager,
MessageBusInterface $eventBus,
Expand All @@ -37,7 +37,7 @@ public function let(
$this->beConstructedWith($creditMemoGenerator, $creditMemoManager, $eventBus, $orderRepository);
}

public function it_generates_credit_memo(
function it_generates_credit_memo(
CreditMemoGeneratorInterface $creditMemoGenerator,
ObjectManager $creditMemoManager,
MessageBusInterface $eventBus,
Expand Down
6 changes: 3 additions & 3 deletions spec/CommandHandler/RefundUnitsHandlerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

final class RefundUnitsHandlerSpec extends ObjectBehavior
{
public function let(
function let(
RefunderInterface $orderItemUnitsRefunder,
RefunderInterface $orderShipmentsRefunder,
MessageBusInterface $eventBus,
Expand All @@ -45,7 +45,7 @@ public function let(
);
}

public function it_handles_command_and_create_refund_for_each_refunded_unit(
function it_handles_command_and_create_refund_for_each_refunded_unit(
RefunderInterface $orderItemUnitsRefunder,
RefunderInterface $orderShipmentsRefunder,
MessageBusInterface $eventBus,
Expand All @@ -70,7 +70,7 @@ public function it_handles_command_and_create_refund_for_each_refunded_unit(
$this(new RefundUnits('000222', $unitRefunds, $shipmentRefunds, 1, 'Comment'));
}

public function it_throws_an_exception_if_order_is_not_available_for_refund(
function it_throws_an_exception_if_order_is_not_available_for_refund(
RefundUnitsCommandValidatorInterface $refundUnitsCommandValidator
): void {
$refundUnitsCommand = new RefundUnits(
Expand Down
Loading

0 comments on commit a0d4955

Please sign in to comment.