Completed
Push — 1.x ( 3a06bd...cc30df )
by Akihito
24s queued 12s
created

Php73BcSerializableTrait::serialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\QueryRepository;
6
7
use function serialize;
8
use function unserialize;
9
10
trait Php73BcSerializableTrait
11
{
12
    /**
13
     * {@inheritDoc}
14
     */
15
    final public function serialize()
16
    {
17
        return serialize($this->__serialize());
0 ignored issues
show
Bug introduced by
The method __serialize() does not exist on BEAR\QueryRepository\Php73BcSerializableTrait. 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

17
        return serialize($this->/** @scrutinizer ignore-call */ __serialize());

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...
18
    }
19
20
    /**
21
     * @psalm-suppress all
22
     *
23
     * {@inheritDoc}
24
     */
25
    final public function unserialize($serializedData)
26
    {
27
        $array = unserialize($serializedData);
28
        $this->__unserialize($array); // @phpstan-ignore-line
0 ignored issues
show
Bug introduced by
The method __unserialize() does not exist on BEAR\QueryRepository\Php73BcSerializableTrait. 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
               __unserialize($array); // @phpstan-ignore-line

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