diff --git a/src/Common/AbstractGateway.php b/src/Common/AbstractGateway.php index 17de242a..33443360 100755 --- a/src/Common/AbstractGateway.php +++ b/src/Common/AbstractGateway.php @@ -64,7 +64,7 @@ abstract class AbstractGateway implements GatewayInterface * @param ClientInterface $httpClient A HTTP client to make API calls with * @param HttpRequest $httpRequest A Symfony HTTP request object */ - public function __construct(ClientInterface $httpClient = null, HttpRequest $httpRequest = null) + public function __construct(?ClientInterface $httpClient = null, ?HttpRequest $httpRequest = null) { $this->httpClient = $httpClient ?: $this->getDefaultHttpClient(); $this->httpRequest = $httpRequest ?: $this->getDefaultHttpRequest(); diff --git a/src/Common/CreditCard.php b/src/Common/CreditCard.php index c92285ba..45a08472 100644 --- a/src/Common/CreditCard.php +++ b/src/Common/CreditCard.php @@ -190,7 +190,7 @@ public function addSupportedBrand($name, $expression) * @param array $parameters An associative array of parameters * @return $this */ - public function initialize(array $parameters = null) + public function initialize(?array $parameters = null) { $this->parameters = new ParameterBag; diff --git a/src/Common/GatewayFactory.php b/src/Common/GatewayFactory.php index 0b5ff250..8d887d59 100644 --- a/src/Common/GatewayFactory.php +++ b/src/Common/GatewayFactory.php @@ -77,7 +77,7 @@ public function register($className) * @throws RuntimeException If no such gateway is found * @return GatewayInterface An object of class $class is created and returned */ - public function create($class, ClientInterface $httpClient = null, HttpRequest $httpRequest = null) + public function create($class, ?ClientInterface $httpClient = null, ?HttpRequest $httpRequest = null) { $class = Helper::getGatewayClassName($class); diff --git a/src/Common/Http/Client.php b/src/Common/Http/Client.php index abd4a53d..e20a6106 100644 --- a/src/Common/Http/Client.php +++ b/src/Common/Http/Client.php @@ -29,7 +29,7 @@ class Client implements ClientInterface */ private $requestFactory; - public function __construct($httpClient = null, RequestFactory $requestFactory = null) + public function __construct($httpClient = null, ?RequestFactory $requestFactory = null) { $this->httpClient = $httpClient ?: HttpClientDiscovery::find(); $this->requestFactory = $requestFactory ?: MessageFactoryDiscovery::find(); diff --git a/src/Common/Item.php b/src/Common/Item.php index 7279abc4..870ee528 100644 --- a/src/Common/Item.php +++ b/src/Common/Item.php @@ -22,7 +22,7 @@ class Item implements ItemInterface * * @param array|null $parameters An array of parameters to set on the new object */ - public function __construct(array $parameters = null) + public function __construct(?array $parameters = null) { $this->initialize($parameters); } @@ -33,7 +33,7 @@ public function __construct(array $parameters = null) * @param array|null $parameters An array of parameters to set on this object * @return $this Item */ - public function initialize(array $parameters = null) + public function initialize(?array $parameters = null) { $this->parameters = new ParameterBag; diff --git a/src/Omnipay.php b/src/Omnipay.php index d3bf7fb0..85903958 100644 --- a/src/Omnipay.php +++ b/src/Omnipay.php @@ -83,7 +83,7 @@ public static function getFactory() * * @param GatewayFactory $factory A GatewayFactory instance */ - public static function setFactory(GatewayFactory $factory = null) + public static function setFactory(?GatewayFactory $factory = null) { self::$factory = $factory; }