headers->get('lock-token'); if (null === $token) { return null; } if (str_starts_with($token, '"')) { $token = substr($token, 1, -1); } if (str_starts_with($token, '<')) { $token = substr($token, 1); } if (str_ends_with($token, '>')) { $token = substr($token, 0, -1); } if (str_ends_with($token, '"')) { $token = substr($token, 1, -1); } return $token; } public function parseIfCondition(Request $request): ?string { $if = $request->headers->get('if'); if (null === $if) { return null; } if (preg_match('/\((?:not\s+)?<([^>]+)>/i', $if, $matches)) { return $matches[1]; } return null; } }