Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126080 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id EA08A1A00BD for ; Fri, 29 Nov 2024 12:21:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1732882692; bh=Cx9e0OQGwQAe7Nrov7ukArh1NylUy5821JBEVLAjB7E=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YcZhy219UkB+ocTzZD9TJPEDbwfLu4sFeqopTYprswPSOEfrGvlBGgqiTwQQkYMNC vTB1rVA1+LO7JytJhuy4O0e2iWDm1+xILmX76PWHLnmDTYYt1SjhkQOdv6hSC7m9k5 zR1xm7RaHQjdPOfnJ2ivi5phgNPZfDsm/6X2HKXt3ZNAMLx8jhV4q+NmlcWLBwcJ2b MmfIBG5JgfE4maoS4nDzefGyuXVHEX1iXedRqZjAAsV4HJj0EEYoB97w8WLWR1zhYS 5Z2tbkUp7tkK/ZWPv0ZceevbZyekyXHby81jo7M3mVE2/becOtHz9Mfk1ZIBPAcplL 6PEW4sIGRlHfw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7239C18004D for ; Fri, 29 Nov 2024 12:18:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 29 Nov 2024 12:18:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1732882877; bh=reGpFqUCWLK1qOA68oV8m5QRYMENtIlQ3kqXVUXuhos=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=To9jDHeediWw0n+6OoEqLqnRGKGTnCN3vwQZRX0upKy1EY96Audz12u9yyPWQ/FxK dXdc00pA4XNG9n0Q0Rae6RaFi4+QrPM4jgnZPbnztQ6NTUzOkAMf5HQG7v3/i0WHvi 5HOHQFfnDzmC/7Imfyc8zd9ZzEzbVHJqu6H7o5ndd8pyo/hnUurIRDLProJRTwcmiM opPXoC+9emSxzNl85UxTHXLsMiykQzi4bCXRoGN4qTTw3GTm7cY0iLu+MWlaffQ+67 aJ1ztrO+aq6dR26YNxwwwaaXm0u40lVinCCRjTl8EDVdOev8NpHsEmRZL/ZRk4kLTK XSzy2O6ifcFtw== Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Fri, 29 Nov 2024 13:21:17 +0100 To: =?UTF-8?Q?M=C3=A1t=C3=A9_Kocsis?= Cc: ignace nyamagana butera , Niels Dossche , internals@lists.php.net Subject: Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API In-Reply-To: References: Message-ID: <57d09ef6591a4c70e60569b9de7ce330@bastelstu.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2024-08-26 09:40, schrieb Máté Kocsis: > Please re-read the RFC as it shares a bit more details than my quick > summary above: https://wiki.php.net/rfc/url_parsing_api I have now finally found the time to go through the discussion thread and make a first pass through the RFC and have the following remarks. 1. The RFC is not listed in the overview page: https://wiki.php.net/rfc 2. I agree with Dennis' remark that the `Rfc3986Uri` and `WhatWgUri` classes must be final. The RFC makes the argument that: > Having separate classes for the two standards makes it possible to > indicate explicit intent at the type level that one specific standard > is required. Developers extending the classes could accidentally violate the respective standard, which nullifies the benefit of making invalid states unrepresentable at the type-level. This also means that the return type of the “withers” should be `self` instead of `static`, which also means that the “withers” in the interface must be `self`. Perhaps this means that they should not exist on the interface at all. `DateTimeInterface` only provides the getters, likely for a similar reason. 3. I believe the `UriException` class as the base exception should not be `abstract`. There is no real benefit to it, especially since it doesn't specify any additional abstract methods. See also the PR introducing the Exception hierarchy for ext/random for some opinions / arguments regarding the Exception class design: https://github.com/php/php-src/pull/9220 4. I'm not sure I like the `Interface` suffix on the `UriInterface` interface. Just `Uri\Uri` would be equally expressive. 5. I am not sure about the `*User()` and `*Password()` methods existing on the interface. As the RFC acknowledges, RFC 3986 only specifies a “userinfo” segment. Should the `*User()` and `*Password()` methods perhaps be specific to the `WhatWgUri` class? ------- I'll give the RFC another read later and expect some additional commentary when I think about this more. Best regards Tim Düsterhus