mirror of
https://github.com/Neur0toxine/pock.git
synced 2025-01-30 20:41:44 +03:00
fix phpstan
This commit is contained in:
parent
a5f7f280f2
commit
1de2133b12
@ -15,11 +15,6 @@ parameters:
|
||||
count: 3
|
||||
path: src/Comparator/ComparatorLocator.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$encoders of class Symfony\\\\Component\\\\Serializer\\\\Serializer constructor expects array\\<Symfony\\\\Component\\\\Serializer\\\\Encoder\\\\DecoderInterface\\|Symfony\\\\Component\\\\Serializer\\\\Encoder\\\\EncoderInterface\\>, array\\<int, object\\> given\\.$#"
|
||||
count: 1
|
||||
path: src/Creator/AbstractSymfonySerializerCreator.php
|
||||
|
||||
-
|
||||
message: "#^Unsafe access to private property Pock\\\\Factory\\\\JsonSerializerFactory\\:\\:\\$mainSerializer through static\\:\\:\\.$#"
|
||||
count: 2
|
||||
|
@ -30,13 +30,13 @@ abstract class AbstractJmsSerializerCreator implements SerializerCreatorInterfac
|
||||
{
|
||||
if (
|
||||
class_exists(self::BUILDER_CLASS) &&
|
||||
method_exists(self::BUILDER_CLASS, 'create')
|
||||
method_exists(self::BUILDER_CLASS, 'create') // @phpstan-ignore-line
|
||||
) {
|
||||
try {
|
||||
$builder = call_user_func([self::BUILDER_CLASS, 'create']);
|
||||
$builder = call_user_func([self::BUILDER_CLASS, 'create']); // @phpstan-ignore-line
|
||||
|
||||
if (null !== $builder && method_exists($builder, 'build')) {
|
||||
return new JmsSerializerAdapter($builder->build(), static::getFormat());
|
||||
if (null !== $builder && method_exists($builder, 'build')) { // @phpstan-ignore-line
|
||||
return new JmsSerializerAdapter($builder->build(), static::getFormat()); // @phpstan-ignore-line
|
||||
}
|
||||
} catch (Throwable $throwable) {
|
||||
return null;
|
||||
|
@ -34,7 +34,7 @@ abstract class AbstractSymfonySerializerCreator implements SerializerCreatorInte
|
||||
$encoder = static::getEncoderClass();
|
||||
|
||||
return new SymfonySerializerAdapter(
|
||||
new $serializer([new $normalizer()], [new $encoder()]),
|
||||
new $serializer([new $normalizer()], [new $encoder()]), // @phpstan-ignore-line
|
||||
static::getFormat()
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user