| @@ -21,9 +21,9 @@ | ||
| 21 | 21 | * |
| 22 | 22 | * One of following functions needs to be available |
| 23 | 23 | * in order to generate random bytes used for UUID |
| 24 | 24 | * (SDK will attempt to utilize function in following order): |
| 25 | - * - random_bytes (requires PHP 7.0 or above) | |
| 25 | + * - random_bytes (requires PHP 7.0 or above) | |
| 26 | 26 | * - openssl_random_pseudo_bytes (requires 'openssl' module enabled) |
| 27 | 27 | * - mcrypt_create_iv (requires 'mcrypt' module enabled) |
| 28 | 28 | * |
| 29 | 29 | * You may also supply a custom bytes generator as an optional second |
| @@ -33,21 +33,21 @@ | ||
| 33 | 33 | * @param callable|null $bytesGenerator |
| 34 | 34 | * |
| 35 | 35 | * @return callable |
| 36 | 36 | */ |
| 37 | - public static function wrap(Service $service, callable $bytesGenerator = null) | |
| 37 | + public static function wrap(Service $service, ?callable $bytesGenerator = null) | |
| 38 | 38 | { |
| 39 | 39 | return function (callable $handler) use($service, $bytesGenerator) { |
| 40 | 40 | return new self($handler, $service, $bytesGenerator); |
| 41 | 41 | }; |
| 42 | 42 | } |
| 43 | - public function __construct(callable $nextHandler, Service $service, callable $bytesGenerator = null) | |
| 43 | + public function __construct(callable $nextHandler, Service $service, ?callable $bytesGenerator = null) | |
| 44 | 44 | { |
| 45 | 45 | $this->bytesGenerator = $bytesGenerator ?: $this->findCompatibleRandomSource(); |
| 46 | 46 | $this->service = $service; |
| 47 | 47 | $this->nextHandler = $nextHandler; |
| 48 | 48 | } |
| 49 | - public function __invoke(CommandInterface $command, RequestInterface $request = null) | |
| 49 | + public function __invoke(CommandInterface $command, ?RequestInterface $request = null) | |
| 50 | 50 | { |
| 51 | 51 | $handler = $this->nextHandler; |
| 52 | 52 | if ($this->bytesGenerator) { |
| 53 | 53 | $operation = $this->service->getOperation($command->getName()); |