Issues (19)

src/SerializationHelper.php (4 issues)

1
<?php
2
3
declare(strict_types=1);
4
5
namespace Metadata;
6
7
trait SerializationHelper
8
{
9
    /**
10
     * @deprecated Use serializeToArray
11
     *
12
     * @return string
13
     */
14
    public function serialize()
15
    {
16
        return serialize($this->serializeToArray());
0 ignored issues
show
The method serializeToArray() does not exist on Metadata\SerializationHelper. Did you maybe mean serialize()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

16
        return serialize($this->/** @scrutinizer ignore-call */ serializeToArray());

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
17
    }
18
19
    /**
20
     * @deprecated Use unserializeFromArray
21
     *
22
     * @param string $str
23
     *
24
     * @return void
25
     */
26
    public function unserialize($str)
27
    {
28
        $this->unserializeFromArray(unserialize($str));
0 ignored issues
show
The method unserializeFromArray() does not exist on Metadata\SerializationHelper. Did you maybe mean serialize()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

28
        $this->/** @scrutinizer ignore-call */ 
29
               unserializeFromArray(unserialize($str));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
29
    }
30
31
    public function __serialize(): array
32
    {
33
        return [$this->serialize()];
0 ignored issues
show
Deprecated Code introduced by
The function Metadata\SerializationHelper::serialize() has been deprecated: Use serializeToArray ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

33
        return [/** @scrutinizer ignore-deprecated */ $this->serialize()];

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
34
    }
35
36
    public function __unserialize(array $data): void
37
    {
38
        $this->unserialize($data[0]);
0 ignored issues
show
Deprecated Code introduced by
The function Metadata\SerializationHelper::unserialize() has been deprecated: Use unserializeFromArray ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

38
        /** @scrutinizer ignore-deprecated */ $this->unserialize($data[0]);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
39
    }
40
}
41