public function limitObject($var, $depth, array &$references)
    {
        $hash = spl_object_hash($var);

        if (in_array($hash, $references)) {
            return '*RECURSION*';
        }

        $references[] = $hash;
        $ref = new \ReflectionObject($var);
        foreach ($ref->getProperties() as $prop) {
            $prop->setAccessible(true);

            $prop->setValue($var, $this->limit($prop->getValue($var), $depth + 1, $references));
        }

        return $var;
    }