GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 17-18 lines in 2 locations

src/Gica/Serialize/ObjectHydrator/ObjectUnserializer/WithStaticFactory/FromPrimitive.php 1 location

@@ 12-28 (lines=17) @@
9
use Gica\Serialize\ObjectHydrator\Exception\ValueNotUnserializable;
10
use Gica\Serialize\ObjectHydrator\ObjectUnserializer;
11
12
class FromPrimitive implements ObjectUnserializer
13
{
14
15
    /**
16
     * @inheritdoc
17
     */
18
    public function tryToUnserializeValue(string $objectClassName, $serializedValue)
19
    {
20
        if (is_scalar($serializedValue) || is_array($serializedValue)) {
21
            if (is_callable([$objectClassName, 'fromPrimitive'])) {
22
                return call_user_func([$objectClassName, 'fromPrimitive'], $serializedValue);
23
            }
24
        }
25
26
        throw  new ValueNotUnserializable();
27
    }
28
}

src/Gica/Serialize/ObjectHydrator/ObjectUnserializer/WithStaticFactory/FromString.php 1 location

@@ 12-29 (lines=18) @@
9
use Gica\Serialize\ObjectHydrator\Exception\ValueNotUnserializable;
10
use Gica\Serialize\ObjectHydrator\ObjectUnserializer;
11
12
class FromString implements ObjectUnserializer
13
{
14
15
    /**
16
     * @inheritdoc
17
     */
18
    public function tryToUnserializeValue(string $objectClassName, $serializedValue)
19
    {
20
        if ((is_string($serializedValue) || is_callable([$serializedValue, '__toString']))) {
21
            if (is_callable([$objectClassName, 'fromString'])) {
22
23
                return call_user_func([$objectClassName, 'fromString'], (string)$serializedValue);
24
            }
25
        }
26
27
        throw  new ValueNotUnserializable();
28
    }
29
}