src/Router/Routes/Glob.php
protected function createRoute($value)
    {
        if ($value instanceof Route) {
            return $value;
        }
        
        if (is_array($value)) {
            $value = (object)$value;
        }
        
        if (is_object($value) && is_callable($value)) {
            $value = (object)['fn' => $value];
        }
        
        if (!$value instanceof \stdClass) {
            throw new \InvalidArgumentException("Unable to create a Route from value " . var_export($value, true));
        }
        
        return new Route($value);
    }
protected function createRoute($value)
    {
        if ($value instanceof Route) {
            return $value;
        }
        
        if (is_array($value)) {
            $value = (object)$value;
        }
        
        if (is_object($value) && is_callable($value)) {
            $value = (object)['fn' => $value];
        }
        
        if (!$value instanceof \stdClass) {
            throw new \InvalidArgumentException("Unable to create a Route from value " . var_export($value, true));
        }
        
        return new Route($value);
    }
protected function createRoute ( $ value ) { if ( $ value instanceof Route ) { return $ value ; } if ( is_array ( $ value ) ) { $ value = ( object ) $ value ; } if ( is_object ( $ value ) && is_callable ( $ value ) ) { $ value = ( object ) [ 'fn' => $ value ] ; } if ( ! $ value instanceof \ stdClass ) { throw new \ InvalidArgumentException ( "Unable to create a Route from value " . var_export ( $ value , true ) ) ; } return new Route ( $ value ) ; }
Create a route from an assisiative array or stdClass object

@param Route|\stdClass|array $value
@return Route
Create a route from an assisiative array or stdClass object