Skip to content

Commit

Permalink
Fix PHP 8.0 deprecations - required parameter follows optional parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
pamil committed Apr 22, 2021
1 parent 33d549a commit 552d3df
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Sylius/Behat/Context/Setup/CustomerContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function theStoreHasCustomerWithFirstName($email, $firstName)
* @Given the store has customer :email with name :fullName since :since
* @Given the store has customer :email with name :fullName and phone number :phoneNumber since :since
*/
public function theStoreHasCustomerWithNameAndRegistrationDate($email, $fullName, $phoneNumber = null, $since)
public function theStoreHasCustomerWithNameAndRegistrationDate($email, $fullName, $since, $phoneNumber = null)
{
$names = explode(' ', $fullName);
$customer = $this->createCustomer($email, $names[0], $names[1], new \DateTime($since), $phoneNumber);
Expand Down
4 changes: 2 additions & 2 deletions src/Sylius/Behat/Context/Setup/OrderContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -641,9 +641,9 @@ public function customersHaveAddedProductsToTheCartForTotalOf($numberOfCustomers
* @Given then :numberOfCustomers more customers have placed :numberOfOrders orders for total of :total
*/
public function customersHavePlacedOrdersForTotalOf(
string $total,
int $numberOfCustomers = 1,
int $numberOfOrders = 1,
string $total
int $numberOfOrders = 1
): void {
$this->createOrders($numberOfCustomers, $numberOfOrders, $total);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function iWantToModifyAPaymentMethod(PaymentMethodInterface $paymentMetho
* @When I rename it to :name in :language
* @When I remove its name from :language translation
*/
public function iNameItIn($name = null, $language)
public function iNameItIn(string $language, ?string $name = null): void
{
/** @var CreatePageInterface|UpdatePageInterface $currentPage */
$currentPage = $this->currentPageResolver->getCurrentPageWithForm([$this->createPage, $this->updatePage]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function iDoNotNameIt()
* @When I rename it to :name in :language
* @When I remove its name from :language translation
*/
public function iRenameItToInLanguage($name = null, $language)
public function iRenameItToInLanguage(string $language, ?string $name = null): void
{
$this->updatePage->nameItIn($name ?? '', $language);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function iNameItInLanguage($name, $language)
* @When I rename it to :name in :language
* @When I remove its name from :language translation
*/
public function iRenameItToInLanguage($name = null, $language)
public function iRenameItToInLanguage(string $language, ?string $name = null): void
{
$this->updatePage->nameItIn($name ?? '', $language);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Bundle/OrderBundle/Form/Type/CartItemType.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CartItemType extends AbstractResourceType

public function __construct(
string $dataClass,
array $validationGroups = [],
array $validationGroups,
DataMapperInterface $dataMapper
) {
parent::__construct($dataClass, $validationGroups);
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Bundle/OrderBundle/Form/Type/OrderItemType.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class OrderItemType extends AbstractResourceType

public function __construct(
string $dataClass,
array $validationGroups = [],
array $validationGroups,
DataMapperInterface $dataMapper
) {
parent::__construct($dataClass, $validationGroups);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class GatewayConfigType extends AbstractResourceType

public function __construct(
string $dataClass,
array $validationGroups = [],
array $validationGroups,
FormTypeRegistryInterface $gatewayConfigurationTypeRegistry
) {
parent::__construct($dataClass, $validationGroups);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ abstract class AbstractConfigurablePromotionElementType extends AbstractResource
/** @var FormTypeRegistryInterface */
private $formTypeRegistry;

public function __construct(string $dataClass, array $validationGroups = [], FormTypeRegistryInterface $formTypeRegistry)
public function __construct(string $dataClass, array $validationGroups, FormTypeRegistryInterface $formTypeRegistry)
{
parent::__construct($dataClass, $validationGroups);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ abstract class AbstractConfigurableShippingMethodElementType extends AbstractRes
/** @var FormTypeRegistryInterface */
private $formTypeRegistry;

public function __construct(string $dataClass, array $validationGroups = [], FormTypeRegistryInterface $formTypeRegistry)
public function __construct(string $dataClass, array $validationGroups, FormTypeRegistryInterface $formTypeRegistry)
{
parent::__construct($dataClass, $validationGroups);

Expand Down

0 comments on commit 552d3df

Please sign in to comment.