Code Duplication    Length = 4-4 lines in 2 locations

src/Controller/RouteAction.php 1 location

@@ 60-63 (lines=4) @@
57
            $route = (object)$route;
58
        }
59
        
60
        if (!$route instanceof \stdClass) {
61
            $type = (is_object($route) ? get_class($route) . ' ' : '') . gettype($route);
62
            throw new \UnexpectedValueException("Expected route to be a stdClass object, not a $type");
63
        }
64
        
65
        return $route;
66
    }

src/Controller/View/Twig.php 1 location

@@ 52-55 (lines=4) @@
49
     */
50
    protected function assertViewVariableName($name)
51
    {
52
        if (!is_string($name)) {
53
            $type = (is_object($name) ? get_class($name) . ' ' : '') . gettype($name);
54
            throw new \InvalidArgumentException("Expected name to be a string, not a $type");
55
        }
56
57
        if (!preg_match('/^[a-z]\w*$/i', $name)) {
58
            throw new \InvalidArgumentException("Invalid name '$name'");