Skip to content
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

Add implicit nullable parameters #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/fXmlRpc/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ final class Client implements ClientInterface
* If no specific transport, parser or serializer is passed, default implementations
* are used.
*
* @param string $uri
* @param null|string $uri
* @param TransportInterface $transport
* @param Parser\ParserInterface $parser
* @param Serializer\SerializerInterface $serializer
*/
public function __construct(
$uri = null,
TransportInterface $transport = null,
ParserInterface $parser = null,
SerializerInterface $serializer = null
?TransportInterface $transport = null,
?ParserInterface $parser = null,
?SerializerInterface $serializer = null
)
{
$this->uri = $uri;
Expand Down
2 changes: 1 addition & 1 deletion src/fXmlRpc/Exception/HttpException.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

final class HttpException extends AbstractTransportException
{
public static function httpError($message, $statusCode, Exception $previous = null)
public static function httpError($message, $statusCode, ?Exception $previous = null)
{
return new static('An HTTP error occurred: ' . $message, $statusCode, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/fXmlRpc/MulticallBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct(ClientInterface $client)
}

/** {@inheritdoc} */
public function addCall($methodName, array $params = [], callable $onSuccess = null, callable $onError = null)
public function addCall($methodName, array $params = [], ?callable $onSuccess = null, ?callable $onError = null)
{
if (!is_string($methodName)) {
throw InvalidArgumentException::expectedParameter(1, 'string', $methodName);
Expand Down
6 changes: 3 additions & 3 deletions src/fXmlRpc/MulticallBuilderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ public function onError(callable $handler);
*
* @param string $methodName
* @param array $params
* @param callable $onSuccess
* @param callable $onError
* @param null|callable $onSuccess
* @param null|callable $onError
* @return MulticallBuilderInterface
*/
public function addCall($methodName, array $params = [], callable $onSuccess = null, callable $onError = null);
public function addCall($methodName, array $params = [], ?callable $onSuccess = null, ?callable $onError = null);

/**
* Send the multicall request to the server
Expand Down
2 changes: 1 addition & 1 deletion src/fXmlRpc/Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Proxy
/**
* @param ClientInterface $client
* @param string $namespaceSeparator
* @param string $namespace
* @param null|string $namespace
*/
public function __construct(ClientInterface $client, $namespaceSeparator = '.', $namespace = null)
{
Expand Down
6 changes: 3 additions & 3 deletions src/fXmlRpc/Timing/Psr3TimerBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ final class Psr3TimerBridge extends AbstractTimerBridge
* Allows passing custom log level and message template (with sprintf() control characters) for log message
* customization
*
* @param LoggerInterface $logger
* @param integer $level
* @param string $messageTemplate
* @param LoggerInterface $logger
* @param null|integer $level
* @param null|string $messageTemplate
*/
public function __construct(LoggerInterface $logger, $level = null, $messageTemplate = null)
{
Expand Down
6 changes: 3 additions & 3 deletions src/fXmlRpc/Timing/ZendFrameworkOneTimerBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ final class ZendFrameworkOneTimerBridge extends AbstractTimerBridge
* Allows passing custom log level and message template (with sprintf() control characters) for log message
* customization
*
* @param Log $logger
* @param integer $level
* @param string $messageTemplate
* @param Log $logger
* @param null|integer $level
* @param null|string $messageTemplate
*/
public function __construct(Log $logger, $level = null, $messageTemplate = null)
{
Expand Down
6 changes: 3 additions & 3 deletions src/fXmlRpc/Timing/ZendFrameworkTwoTimerBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ final class ZendFrameworkTwoTimerBridge extends AbstractTimerBridge
* Allows passing custom log level and message template (with sprintf() control characters) for log message
* customization
*
* @param LoggerInterface $logger
* @param string $method
* @param string $messageTemplate
* @param LoggerInterface $logger
* @param null|string $method
* @param null|string $messageTemplate
*/
public function __construct(LoggerInterface $logger, $method = null, $messageTemplate = null)
{
Expand Down