public static function expiration(string $key, ?string $storage = 'global'): ?int
    {
        if (!self::has($key)) {
            return null;
        }

        // Get content.
        $fileKey = self::key($key);
        $content = null;
        if (file_exists(self::$path . '/' . $storage . '/' . $fileKey)) {
            $content = file_get_contents(self::$path . '/' . $storage . '/' . $fileKey);
        }

        // Extract expiration.
        $markerPos = strpos($content, self::$marker);
        $expiration = null;
        if ($markerPos !== false) {
            $expiration = intval(substr($content, 0, $markerPos));
        }

        return $expiration;
    }