Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
Merge 3.x into master
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI committed Apr 15, 2020
2 parents 69b81ff + 122916b commit aad4f8d
Show file tree
Hide file tree
Showing 60 changed files with 114 additions and 120 deletions.
1 change: 1 addition & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ $rules = [
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
'no_useless_else' => true,
'no_useless_return' => true,
'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => true],
'ordered_class_elements' => true,
'ordered_imports' => true,
'phpdoc_order' => true,
Expand Down
2 changes: 1 addition & 1 deletion src/BasketBundle/Block/BasketBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
class BasketBlockService extends AbstractAdminBlockService
{
public function execute(BlockContextInterface $blockContext, Response $response = null)
public function execute(BlockContextInterface $blockContext, ?Response $response = null)
{
return $this->renderResponse($blockContext->getTemplate(), [
'block' => $blockContext->getBlock(),
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Basket/BaseBasketFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ protected function storeInSession(BasketInterface $basket): void
*
* @return string
*/
protected function getSessionVarName(CustomerInterface $customer = null)
protected function getSessionVarName(?CustomerInterface $customer = null)
{
if (null === $customer || null === $customer->getId()) {
return self::SESSION_BASE_NAME.'new';
Expand Down
10 changes: 5 additions & 5 deletions src/Component/Basket/Basket.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public function isValid($elementsOnly = false)
return true;
}

public function setDeliveryMethod(ServiceDeliveryInterface $method = null): void
public function setDeliveryMethod(?ServiceDeliveryInterface $method = null): void
{
$this->deliveryMethod = $method;
$this->deliveryMethodCode = $method ? $method->getCode() : null;
Expand All @@ -184,7 +184,7 @@ public function getDeliveryMethod()
return $this->deliveryMethod;
}

public function setDeliveryAddress(AddressInterface $address = null): void
public function setDeliveryAddress(?AddressInterface $address = null): void
{
$this->deliveryAddress = $address;
$this->deliveryAddressId = $address ? $address->getId() : null;
Expand All @@ -195,7 +195,7 @@ public function getDeliveryAddress()
return $this->deliveryAddress;
}

public function setPaymentMethod(PaymentInterface $method = null): void
public function setPaymentMethod(?PaymentInterface $method = null): void
{
$this->paymentMethod = $method;
$this->paymentMethodCode = $method ? $method->getCode() : null;
Expand All @@ -206,7 +206,7 @@ public function getPaymentMethod()
return $this->paymentMethod;
}

public function setBillingAddress(AddressInterface $address = null): void
public function setBillingAddress(?AddressInterface $address = null): void
{
$this->billingAddress = $address;
$this->billingAddressId = $address ? $address->getId() : null;
Expand Down Expand Up @@ -598,7 +598,7 @@ public function getDeliveryMethodCode()
return $this->deliveryMethodCode;
}

public function setCustomer(CustomerInterface $customer = null): void
public function setCustomer(?CustomerInterface $customer = null): void
{
$this->customer = $customer;
$this->customerId = $customer ? $customer->getId() : null;
Expand Down
10 changes: 5 additions & 5 deletions src/Component/Basket/BasketInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function isValid($elementsOnly = false);
*
* @param ServiceDeliveryInterface $method
*/
public function setDeliveryMethod(ServiceDeliveryInterface $method = null);
public function setDeliveryMethod(?ServiceDeliveryInterface $method = null);

/**
* @return ServiceDeliveryInterface
Expand All @@ -65,7 +65,7 @@ public function getDeliveryMethod();
*
* @param \Sonata\Component\Customer\AddressInterface $address
*/
public function setDeliveryAddress(AddressInterface $address = null);
public function setDeliveryAddress(?AddressInterface $address = null);

/**
* @return \Sonata\Component\Customer\AddressInterface
Expand All @@ -77,7 +77,7 @@ public function getDeliveryAddress();
*
* @param \Sonata\Component\Payment\PaymentInterface $method
*/
public function setPaymentMethod(PaymentInterface $method = null);
public function setPaymentMethod(?PaymentInterface $method = null);

/**
* @return \Sonata\Component\Payment\PaymentInterface
Expand All @@ -89,7 +89,7 @@ public function getPaymentMethod();
*
* @param \Sonata\Component\Customer\AddressInterface $address
*/
public function setBillingAddress(AddressInterface $address = null);
public function setBillingAddress(?AddressInterface $address = null);

/**
* @return \Sonata\Component\Customer\AddressInterface
Expand Down Expand Up @@ -282,7 +282,7 @@ public function getDeliveryMethodCode();
/**
* @param \Sonata\Component\Customer\CustomerInterface $customer
*/
public function setCustomer(CustomerInterface $customer = null);
public function setCustomer(?CustomerInterface $customer = null);

/**
* @param \Sonata\Component\Customer\CustomerInterface
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Customer/CustomerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface CustomerInterface
/**
* Set createdAt.
*/
public function setCreatedAt(\DateTime $createdAt = null);
public function setCreatedAt(?\DateTime $createdAt = null);

/**
* Get createdAt.
Expand Down Expand Up @@ -67,7 +67,7 @@ public function getLastname();
/**
* Set updatedAt.
*/
public function setUpdatedAt(\DateTime $updatedAt = null);
public function setUpdatedAt(?\DateTime $updatedAt = null);

/**
* Get updatedAt.
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Delivery/Selector.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function getProductPool()
return $this->productPool;
}

public function getAvailableMethods(BasketInterface $basket = null, AddressInterface $deliveryAddress = null)
public function getAvailableMethods(?BasketInterface $basket = null, ?AddressInterface $deliveryAddress = null)
{
$instances = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@

interface ServiceDeliverySelectorInterface
{
public function getAvailableMethods(BasketInterface $basket = null, AddressInterface $deliveryAddress = null);
public function getAvailableMethods(?BasketInterface $basket = null, ?AddressInterface $deliveryAddress = null);
}
2 changes: 1 addition & 1 deletion src/Component/Delivery/UndeliverableCountryException.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class UndeliverableCountryException extends \RuntimeException
* @param int $code
* @param Exception $previous
*/
public function __construct(AddressInterface $address, $code = 0, Exception $previous = null)
public function __construct(AddressInterface $address, $code = 0, ?Exception $previous = null)
{
$this->address = $address;

Expand Down
2 changes: 1 addition & 1 deletion src/Component/Event/PaymentEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class PaymentEvent extends Event
* @param TransactionInterface $transaction
* @param Response $response
*/
public function __construct(OrderInterface $order, TransactionInterface $transaction = null, Response $response = null)
public function __construct(OrderInterface $order, ?TransactionInterface $transaction = null, ?Response $response = null)
{
$this->order = $order;
$this->transaction = $transaction;
Expand Down
6 changes: 3 additions & 3 deletions src/Component/Order/OrderElementInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function getDeliveryStatus();
*
* @param \Datetime $validatedAt
*/
public function setValidatedAt(\DateTime $validatedAt = null);
public function setValidatedAt(?\DateTime $validatedAt = null);

/**
* Get validated_at.
Expand Down Expand Up @@ -157,7 +157,7 @@ public function setProductType($productType);
*/
public function getProductType();

public function setCreatedAt(\DateTime $createdAt = null);
public function setCreatedAt(?\DateTime $createdAt = null);

/**
* @return \Datetime
Expand All @@ -167,7 +167,7 @@ public function getCreatedAt();
/**
* @param \Datetime
*/
public function setUpdatedAt(\DateTime $updatedAt = null);
public function setUpdatedAt(?\DateTime $updatedAt = null);

/**
* @return \Datetime
Expand Down
6 changes: 3 additions & 3 deletions src/Component/Order/OrderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function getDeliveryStatus();
*
* @param \Datetime $validatedAt
*/
public function setValidatedAt(\DateTime $validatedAt = null);
public function setValidatedAt(?\DateTime $validatedAt = null);

/**
* Get validated at.
Expand Down Expand Up @@ -571,14 +571,14 @@ public function isOpen();
*/
public function isError();

public function setCreatedAt(\DateTime $createdAt = null);
public function setCreatedAt(?\DateTime $createdAt = null);

/**
* @return \DateTime
*/
public function getCreatedAt();

public function setUpdatedAt(\DateTime $updatedAt = null);
public function setUpdatedAt(?\DateTime $updatedAt = null);

/**
* @return \DateTime
Expand Down
3 changes: 0 additions & 3 deletions src/Component/Payment/BasePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ abstract class BasePayment implements PaymentInterface
*/
protected $transformers;

/**
* @var \Psr\Log\LoggerInterface;
*/
protected $logger;

/**
Expand Down
3 changes: 1 addition & 2 deletions src/Component/Payment/BasePaypal.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
* https://www.paypal.com/IntegrationCenter/ic_button-encryption.html#Createanencryptedbutton
* openssl genrsa -out my-prvkey.pem 1024
* openssl req -new -key my-prvkey.pem -x509 -days 365 -out my-pubcert.pem
* *
*
* @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
*/
Expand Down Expand Up @@ -56,7 +55,7 @@ abstract class BasePaypal extends BasePayment
*/
protected $webConnectorProvider = null;

public function __construct(RouterInterface $router, TranslatorInterface $translator = null)
public function __construct(RouterInterface $router, ?TranslatorInterface $translator = null)
{
$this->router = $router;
$this->translator = $translator;
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Payment/InvalidTransactionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class InvalidTransactionException extends \InvalidArgumentException
* @param int $code
* @param \Exception $previous
*/
public function __construct($orderReference = null, $code = 0, \Exception $previous = null)
public function __construct($orderReference = null, $code = 0, ?\Exception $previous = null)
{
$message = $orderReference ? sprintf('Invalid check - order ref: %s', $orderReference) : 'Unable to find reference';
parent::__construct($message, $code, $previous);
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Payment/PassPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class PassPayment extends BasePayment
/**
* @param \Buzz\Browser $browser
*/
public function __construct(RouterInterface $router, Browser $browser = null)
public function __construct(RouterInterface $router, ?Browser $browser = null)
{
$this->router = $router;
$this->browser = $browser;
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Payment/PaymentNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PaymentNotFoundException extends \InvalidArgumentException
* @param int $code
* @param Exception $previous
*/
public function __construct($bankCode, $code = 0, Exception $previous = null)
public function __construct($bankCode, $code = 0, ?Exception $previous = null)
{
$message = sprintf("Payment method with code '%s' was not found", $bankCode);
parent::__construct($message, $code, $previous);
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Payment/PaymentSelectorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface PaymentSelectorInterface
*
* @return array
*/
public function getAvailableMethods(BasketInterface $basket = null, AddressInterface $deliveryAddress = null);
public function getAvailableMethods(?BasketInterface $basket = null, ?AddressInterface $deliveryAddress = null);

/**
* Returns the Payment method for given $bank.
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Payment/Selector.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Selector implements PaymentSelectorInterface
/**
* @param LoggerInterface $logger
*/
public function __construct(PaymentPool $paymentPool, ProductPool $productPool, LoggerInterface $logger = null)
public function __construct(PaymentPool $paymentPool, ProductPool $productPool, ?LoggerInterface $logger = null)
{
$this->paymentPool = $paymentPool;
$this->productPool = $productPool;
Expand Down Expand Up @@ -70,7 +70,7 @@ public function getProductPool()
return $this->productPool;
}

public function getAvailableMethods(BasketInterface $basket = null, AddressInterface $billingAddress = null)
public function getAvailableMethods(?BasketInterface $basket = null, ?AddressInterface $billingAddress = null)
{
if (!$billingAddress) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Payment/TransactionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function getStatusCode();
*/
public static function getStatusList();

public function setCreatedAt(\DateTime $createdAt = null);
public function setCreatedAt(?\DateTime $createdAt = null);

/**
* @return \DateTime
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Product/DeliveryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function getEnabled();
*
* @param \Datetime $updatedAt
*/
public function setUpdatedAt(\DateTime $updatedAt = null);
public function setUpdatedAt(?\DateTime $updatedAt = null);

/**
* Get updatedAt.
Expand All @@ -116,7 +116,7 @@ public function getUpdatedAt();
*
* @param \Datetime $createdAt
*/
public function setCreatedAt(\DateTime $createdAt = null);
public function setCreatedAt(?\DateTime $createdAt = null);

/**
* Get createdAt.
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Product/PackageInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function getEnabled();
*
* @param \Datetime $updatedAt
*/
public function setUpdatedAt(\DateTime $updatedAt = null);
public function setUpdatedAt(?\DateTime $updatedAt = null);

/**
* Get updatedAt.
Expand All @@ -116,7 +116,7 @@ public function getUpdatedAt();
*
* @param \Datetime $createdAt
*/
public function setCreatedAt(\DateTime $createdAt = null);
public function setCreatedAt(?\DateTime $createdAt = null);

/**
* Get createdAt.
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Product/ProductCategoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function getMain();
*
* @param \DateTime $updatedAt
*/
public function setUpdatedAt(\DateTime $updatedAt = null);
public function setUpdatedAt(?\DateTime $updatedAt = null);

/**
* Get updatedAt.
Expand All @@ -64,7 +64,7 @@ public function getUpdatedAt();
*
* @param \DateTime $createdAt
*/
public function setCreatedAt(\DateTime $createdAt = null);
public function setCreatedAt(?\DateTime $createdAt = null);

/**
* Get createdAt.
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Product/ProductCollectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function getEnabled();
*
* @param \DateTime $updatedAt
*/
public function setUpdatedAt(\DateTime $updatedAt = null);
public function setUpdatedAt(?\DateTime $updatedAt = null);

/**
* Get updatedAt.
Expand All @@ -59,7 +59,7 @@ public function getUpdatedAt();
*
* @param \DateTime $createdAt
*/
public function setCreatedAt(\DateTime $createdAt = null);
public function setCreatedAt(?\DateTime $createdAt = null);

/**
* Get createdAt.
Expand Down

0 comments on commit aad4f8d

Please sign in to comment.