Passed
Pull Request — master (#1031)
by Maxim
23:38
created
src/Serializer/src/Bootloader/SerializerBootloader.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
         private readonly ConfiguratorInterface $config,
33 33
         private readonly ContainerInterface $container,
34 34
         private readonly FactoryInterface $factory
35
-    ) {
35
+    ){
36 36
     }
37 37
 
38 38
     public function init(EnvironmentInterface $env): void
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
             'json' => new JsonSerializer(),
59 59
             'serializer' => new PhpSerializer(),
60 60
         ];
61
-        if (\class_exists(Message::class)) {
61
+        if (\class_exists(Message::class)){
62 62
             $serializers['proto'] = new ProtoSerializer();
63 63
         }
64 64
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      * @throws \Psr\Container\ContainerExceptionInterface
73 73
      * @throws \Psr\Container\NotFoundExceptionInterface
74 74
      */
75
-    private function wire(string|Autowire|SerializerInterface $serializer): SerializerInterface
75
+    private function wire(string | Autowire | SerializerInterface $serializer): SerializerInterface
76 76
     {
77 77
         return match (true) {
78 78
             $serializer instanceof SerializerInterface => $serializer,
Please login to merge, or discard this patch.
src/Serializer/tests/Fixture/PingRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
      *     @type string $url
28 28
      * }
29 29
      */
30
-    public function __construct($data = NULL) {
30
+    public function __construct($data = NULL){
31 31
         \Spiral\Tests\Serializer\Fixture\GPBMetadata\Service::initOnce();
32 32
         parent::__construct($data);
33 33
     }
Please login to merge, or discard this patch.
src/Serializer/src/Serializer/ProtoSerializer.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 {
15 15
     public function __construct()
16 16
     {
17
-        if (!\class_exists(Message::class)) {
17
+        if (!\class_exists(Message::class)){
18 18
             throw new SerializerException('Package `google/protobuf` is not installed.');
19 19
         }
20 20
     }
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
     /**
23 23
      * @throws InvalidArgumentException
24 24
      */
25
-    public function serialize(mixed $payload): string|\Stringable
25
+    public function serialize(mixed $payload): string | \Stringable
26 26
     {
27
-        if (!$payload instanceof Message) {
27
+        if (!$payload instanceof Message){
28 28
             throw new InvalidArgumentException(\sprintf(
29 29
                 'Payload must be of type `%s`, received `%s`.',
30 30
                 Message::class,
@@ -39,13 +39,13 @@  discard block
 block discarded – undo
39 39
      * @throws UnserializeException
40 40
      * @throws InvalidArgumentException
41 41
      */
42
-    public function unserialize(\Stringable|string $payload, object|string|null $type = null): mixed
42
+    public function unserialize(\Stringable | string $payload, object | string | null $type = null): mixed
43 43
     {
44
-        if (\is_object($type)) {
44
+        if (\is_object($type)){
45 45
             $type = $type::class;
46 46
         }
47 47
 
48
-        if ($type === null || !\class_exists($type) || !\is_a($type, Message::class, true)) {
48
+        if ($type === null || !\class_exists($type) || !\is_a($type, Message::class, true)){
49 49
             throw new InvalidArgumentException(\sprintf(
50 50
                 'Parameter `$type` must be of type: `%s`, received `%s`.',
51 51
                 Message::class,
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
 
56 56
         $object = new $type();
57 57
 
58
-        try {
59
-            $object->mergeFromString((string) $payload);
60
-        } catch (\Throwable $e) {
58
+        try{
59
+            $object->mergeFromString((string)$payload);
60
+        }catch (\Throwable $e){
61 61
             throw new UnserializeException(
62 62
                 \sprintf('Failed to unserialize data: %s', $e->getMessage()),
63 63
                 $e->getCode(),
Please login to merge, or discard this patch.