public function set($value = null, $ttl = null)
    {
        $now = new DateTime();

        // whoever came up with the idea of allowing int AND datetime...
        // so lets convert this to an int (its a time to live, not a date to delete ffs)
        if ($ttl instanceof DateTime) {
            $ttl = $ttl->getTimestamp() - $now->getTimestamp();
        }

        $data = [
            "updated" => $now,
            "value" => $value,
            "key" => $this->key,
            "ttl" => $ttl
        ];

        return false !== file_put_contents($this->filename, serialize($data));
    }