protected function trackObjectVisits($object)
    {
        $hash   = spl_object_hash($object);
        $check  = array_search($hash, $this->visited);

        if ($check !== false) {
            $output = new \stdClass();
            $rel = '$rel';
            $output->$rel = $check;

            return $output;
        } else {
            $this->visited[] = $hash;

            return count($this->visited);
        }
    }