diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 702a2221..65675901 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -552,18 +552,6 @@ parameters: count: 2 path: src/lib/FieldType/RichText/RichTextStorage.php - - - message: '#^Property Ibexa\\FieldTypeRichText\\FieldType\\RichText\\RichTextStorage\:\:\$logger \(Psr\\Log\\LoggerInterface\) does not accept Psr\\Log\\LoggerInterface\|null\.$#' - identifier: assign.propertyType - count: 1 - path: src/lib/FieldType/RichText/RichTextStorage.php - - - - message: '#^Property Ibexa\\FieldTypeRichText\\FieldType\\RichText\\RichTextStorage\:\:\$logger \(Psr\\Log\\LoggerInterface\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 1 - path: src/lib/FieldType/RichText/RichTextStorage.php - - message: '#^Method Ibexa\\FieldTypeRichText\\FieldType\\RichText\\RichTextStorage\\Gateway\:\:getContentIds\(\) has parameter \$remoteIds with no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -1345,7 +1333,7 @@ parameters: path: src/lib/RichText/Validator/ValidatorDispatcher.php - - message: '#^PHPDoc tag @param for parameter \$validator with type Ibexa\\FieldTypeRichText\\eZ\\RichText\\Validator is not subtype of native type Ibexa\\Contracts\\FieldTypeRichText\\RichText\\ValidatorInterface\|null\.$#' + message: '#^PHPDoc tag @param for parameter \$validator with type Ibexa\\FieldTypeRichText\\eZ\\RichText\\Validator\|null is not subtype of native type Ibexa\\Contracts\\FieldTypeRichText\\RichText\\ValidatorInterface\|null\.$#' identifier: parameter.phpDocType count: 1 path: src/lib/RichText/Validator/ValidatorDispatcher.php diff --git a/src/lib/FieldType/RichText/RichTextStorage.php b/src/lib/FieldType/RichText/RichTextStorage.php index 174f2271..3782c2c8 100644 --- a/src/lib/FieldType/RichText/RichTextStorage.php +++ b/src/lib/FieldType/RichText/RichTextStorage.php @@ -20,7 +20,7 @@ class RichTextStorage extends GatewayBasedStorage { /** - * @var \Psr\Log\LoggerInterface + * @var \Psr\Log\LoggerInterface|null */ protected $logger; @@ -31,9 +31,9 @@ class RichTextStorage extends GatewayBasedStorage /** * @param \Ibexa\Contracts\Core\FieldType\StorageGateway $gateway - * @param \Psr\Log\LoggerInterface $logger + * @param \Psr\Log\LoggerInterface|null $logger */ - public function __construct(StorageGateway $gateway, LoggerInterface $logger = null) + public function __construct(StorageGateway $gateway, ?LoggerInterface $logger = null) { parent::__construct($gateway); $this->logger = $logger; diff --git a/src/lib/RichText/Converter/Link.php b/src/lib/RichText/Converter/Link.php index 3035bb23..bb8c246c 100644 --- a/src/lib/RichText/Converter/Link.php +++ b/src/lib/RichText/Converter/Link.php @@ -46,7 +46,7 @@ public function __construct( LocationService $locationService, ContentService $contentService, RouterInterface $router, - LoggerInterface $logger = null + ?LoggerInterface $logger = null ) { $this->locationService = $locationService; $this->contentService = $contentService; diff --git a/src/lib/RichText/Converter/Render/Embed.php b/src/lib/RichText/Converter/Render/Embed.php index 0fad007a..a695c5c9 100644 --- a/src/lib/RichText/Converter/Render/Embed.php +++ b/src/lib/RichText/Converter/Render/Embed.php @@ -47,7 +47,7 @@ class Embed extends Render implements Converter 'replace' => '_self', ]; - public function __construct(RendererInterface $renderer, LoggerInterface $logger = null) + public function __construct(RendererInterface $renderer, ?LoggerInterface $logger = null) { parent::__construct($renderer); $this->logger = $logger; diff --git a/src/lib/RichText/Converter/Render/Template.php b/src/lib/RichText/Converter/Render/Template.php index 414208a5..5eb92d2a 100644 --- a/src/lib/RichText/Converter/Render/Template.php +++ b/src/lib/RichText/Converter/Render/Template.php @@ -40,12 +40,12 @@ class Template extends Render implements Converter * * @param \Ibexa\Contracts\FieldTypeRichText\RichText\RendererInterface $renderer * @param \Ibexa\Contracts\FieldTypeRichText\RichText\Converter $richTextConverter - * @param \Psr\Log\LoggerInterface $logger + * @param \Psr\Log\LoggerInterface|null $logger */ public function __construct( RendererInterface $renderer, Converter $richTextConverter, - LoggerInterface $logger = null + ?LoggerInterface $logger = null ) { $this->richTextConverter = $richTextConverter; $this->logger = $logger ?? new NullLogger(); diff --git a/src/lib/RichText/ConverterDispatcher.php b/src/lib/RichText/ConverterDispatcher.php index 7529c469..1ec84ba5 100644 --- a/src/lib/RichText/ConverterDispatcher.php +++ b/src/lib/RichText/ConverterDispatcher.php @@ -40,7 +40,7 @@ public function __construct($converterMap) * @param string $namespace * @param \Ibexa\Contracts\FieldTypeRichText\RichText\Converter|null $converter */ - public function addConverter($namespace, Converter $converter = null) + public function addConverter($namespace, ?Converter $converter = null) { $this->mapping[$namespace] = $converter; } diff --git a/src/lib/RichText/Exception/InvalidXmlException.php b/src/lib/RichText/Exception/InvalidXmlException.php index 54d4a69f..6a2d27be 100644 --- a/src/lib/RichText/Exception/InvalidXmlException.php +++ b/src/lib/RichText/Exception/InvalidXmlException.php @@ -23,7 +23,7 @@ class InvalidXmlException extends InvalidArgumentException * @param array $errors * @param \Throwable|null $previous */ - public function __construct(string $argumentName, array $errors = [], Throwable $previous = null) + public function __construct(string $argumentName, array $errors = [], ?Throwable $previous = null) { $messages = []; foreach ($errors as $error) { diff --git a/src/lib/RichText/Renderer.php b/src/lib/RichText/Renderer.php index 1ba5f621..95e3e93a 100644 --- a/src/lib/RichText/Renderer.php +++ b/src/lib/RichText/Renderer.php @@ -84,7 +84,7 @@ public function __construct( string $tagConfigurationNamespace, string $styleConfigurationNamespace, string $embedConfigurationNamespace, - LoggerInterface $logger = null, + ?LoggerInterface $logger = null, array $customTagsConfiguration = [], array $customStylesConfiguration = [] ) { diff --git a/src/lib/RichText/Validator/ValidatorDispatcher.php b/src/lib/RichText/Validator/ValidatorDispatcher.php index 2da8d7ff..0821e89c 100644 --- a/src/lib/RichText/Validator/ValidatorDispatcher.php +++ b/src/lib/RichText/Validator/ValidatorDispatcher.php @@ -38,9 +38,9 @@ public function __construct($validatorMap) * Adds validator mapping. * * @param string $namespace - * @param \Ibexa\FieldTypeRichText\eZ\RichText\Validator $validator + * @param \Ibexa\FieldTypeRichText\eZ\RichText\Validator|null $validator */ - public function addValidator($namespace, ValidatorInterface $validator = null) + public function addValidator($namespace, ?ValidatorInterface $validator = null) { $this->mapping[$namespace] = $validator; }