Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function inflectRecord($record): Maybe
*
* @return mixed|null
*/
function memoize(callable $callback = null, array $arguments = [], $key = null)
function memoize(?callable $callback = null, array $arguments = [], $key = null)
{
static $storage = [];

Expand Down
4 changes: 2 additions & 2 deletions src/Objects/Exceptions/Exceptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class Exceptions
/**
* @param mixed $record
*/
public static function forEncode($record, \AvroSchema $schema, \Exception $previous = null): AvroEncodingException
public static function forEncode($record, \AvroSchema $schema, ?\Exception $previous = null): AvroEncodingException
{
$exportedRecord = \var_export($record, true);

Expand All @@ -29,7 +29,7 @@ public static function forEncode($record, \AvroSchema $schema, \Exception $previ
return new AvroEncodingException($message, self::ERROR_ENCODING, $previous);
}

public static function forDecode(string $binaryMessage, \Exception $previous = null): AvroDecodingException
public static function forDecode(string $binaryMessage, ?\Exception $previous = null): AvroDecodingException
{
$convertedMessage = \bin2hex($binaryMessage);
$message = <<<MESSAGE
Expand Down
2 changes: 1 addition & 1 deletion src/Objects/RecordSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function encodeRecord(string $subject, AvroSchema $schema, $record): stri
* @throws \Exception
* @throws \FlixTech\SchemaRegistryApi\Exception\SchemaRegistryException
*/
public function decodeMessage(string $binaryMessage, AvroSchema $readersSchema = null)
public function decodeMessage(string $binaryMessage, ?AvroSchema $readersSchema = null)
{
$decoded = decode($binaryMessage);
$schemaId = valueOf($decoded->bind($this->schemaIdGetter));
Expand Down
2 changes: 1 addition & 1 deletion src/Objects/Schema/Generation/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Type
*/
private $attributes;

public function __construct(string $typeName, SchemaAttributes $attributes = null)
public function __construct(string $typeName, ?SchemaAttributes $attributes = null)
{
$this->typeName = $typeName;
$this->attributes = $attributes ?? new SchemaAttributes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function it_should_fail_for_records_not_implementing_the_interface_for_ke
$definitionInterfaceResolver->keySchemaFor([]);
}

private function createAnonymousDefinitionInterface(string $valueSchema, string $keySchema = null): HasSchemaDefinitionInterface
private function createAnonymousDefinitionInterface(string $valueSchema, ?string $keySchema = null): HasSchemaDefinitionInterface
{
$class = new class() implements HasSchemaDefinitionInterface {
/**
Expand Down
Loading