Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118427 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 29998 invoked from network); 12 Aug 2022 05:53:59 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Aug 2022 05:53:59 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8C1671804B5 for ; Fri, 12 Aug 2022 00:56:12 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 12 Aug 2022 00:56:12 -0700 (PDT) Received: by mail-qk1-f177.google.com with SMTP id j6so227667qkl.10 for ; Fri, 12 Aug 2022 00:56:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20210112.gappssmtp.com; s=20210112; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc; bh=YJMxIfIoITTX5/5BwX5+9iR3zGfjHjI2fhDcfd9Mr24=; b=3YbBNePdjDC7pfNaKrrKMKqdA/M14IjEQY3MnYnTjQ5m4mC5JNatopK8kUhyBOdJOZ 4RIudQMHGVDDQ7QHJUWEIoH6wy0TshFn02YXfaS8xJjzL+PHh/hP2JfcN1puZZ3MFt6m 8RLI6iOy4QTVg34vxJLFOlH30jrHEIH8Mj/ElIW5G/HCZH5RNa9DDzN2U2YCMHWxvqLe +HwU9fq7C33cisBqzurM9FkUFt//HUOQf39xjyfbHfdfLVuDB3yOFfe57g9ght5S/Wt0 esyBJns0nvBIm/q/IdgxTrTJ/08+Ci9BjDieJi5WO6NDkCmKk/KNayyYSgYXCM2rZVLp dFwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc; bh=YJMxIfIoITTX5/5BwX5+9iR3zGfjHjI2fhDcfd9Mr24=; b=VHKvFeMuEi21AzAbdCnyvqG/zQTSLdtJr7b4aSkoaDgcOLbm/U/VTU5J/UjVOU3LlP 38fUGYT0JHs+zOC8wZlBhD7l7lO9D2T9l8eqlN5LjNrpqVTVIZ6PG91tkc1400s7LoE5 lRXRUk2NB1JeEuY6mDoJzkYBAls5qVhDgfmL915PHlRTH8rOmFFTLERJ4YtPfMkd/FSQ +3cI3j/rTBLywpyAcuQsnY1CvBtlblUvNGyGlNOdR6s1W8r3oVcRwWDfx0QJ7dOHr9N8 J8fuABuI/VBbcPzZpCDyViwbbPGYBMXK//hBAOlWZsOFGUNWKAIOKXu39HUE0eiRi7CV 8gug== X-Gm-Message-State: ACgBeo31aBtF03WiJ2GsnzndvAspN8/bj8E/H9dd/QV7lUPVLO/4fawa LNYVFAseJGCNvreUSm3Bv8bD9Q== X-Google-Smtp-Source: AA6agR6zVzzDEp1bZq0GECSsceUXAqb3dDXM5yv0iubX/uQlNSMyqEyrhC0hypSfdyRlCRg/YuXmsg== X-Received: by 2002:a05:620a:12c5:b0:6ba:c688:ce40 with SMTP id e5-20020a05620a12c500b006bac688ce40mr1356046qkl.330.1660290971304; Fri, 12 Aug 2022 00:56:11 -0700 (PDT) Received: from [192.168.1.10] (c-24-98-254-8.hsd1.ga.comcast.net. [24.98.254.8]) by smtp.gmail.com with ESMTPSA id u67-20020ae9d846000000b006b89b9024ddsm1210772qkf.24.2022.08.12.00.56.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Aug 2022 00:56:10 -0700 (PDT) X-Google-Original-From: MKS Archive Message-ID: <200696F8-DDD6-4C15-8EA9-FEFC04B38688@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_751442BB-B431-4C55-B29F-3BB6DF336F8F" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Date: Fri, 12 Aug 2022 03:56:09 -0400 In-Reply-To: <6a52a2bc-a6ec-4d69-bc77-4c4b48f63a29@www.fastmail.com> Cc: =?utf-8?Q?Bj=C3=B6rn_Larsson?= , php internals To: Ollie Read References: <6576371A-9C18-4BC4-ADA6-8F364208BF01@newclarity.net> <6a52a2bc-a6ec-4d69-bc77-4c4b48f63a29@www.fastmail.com> X-Mailer: Apple Mail (2.3608.120.23.2.7) Subject: Re: [PHP-DEV] [RFC] Asymmetric visibility From: mike@newclarity.net (MKS Archive) --Apple-Mail=_751442BB-B431-4C55-B29F-3BB6DF336F8F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi Ollie, > On Aug 8, 2022, at 6:12 AM, Ollie Read wrote: >=20 > On Mon, Aug 8, 2022, at 3:54 AM, Mike Schinkel wrote: >> 3.) I have concerns about the proposed methods isProtectedSet() and = isPrivateSet(). =20 >>=20 >> These names feels like we are asking if some thing "Set" is = "Protected" or "Private" where no such "thing" exists in this context. =20= >>=20 >> In other words it reads as if you are asking "Is it a *protected* = Set?" or "Is it a *private* Set?" Such naming also does not relate to = the Property itself which is what the prefix verb "is" is acting on. >>=20 >> I would propose instead we consider the following are these instead = would be asking the *ability* to "Set" the Property is "Protected" or = "Private" where The Property is again what the prefix verb "is" is = acting on: >>=20 >> isSetProtected() >> isSetPrivate() >> isGetProtected(), and >> isGetPrivate() >=20 > I feel almost as if we shouldn't pollute ReflectionProperty with these = additional methods but should instead have something like = ReflectionAsymmetricProperty, which would in turn extend = ReflectionProperty.=20 On my 3rd point that you quoted my primary concern was that I felt the = RFC solution of "isSet()" was hard to reason about but my own = suggestion almost incidental. I felt if I voiced my concerns then it = would be incumbent upon me to at least suggest an alternative. OTOH, I'm not sure I would embrace yet another reflection class. I think = that would make an already (IMO) too-complex reflection class hierarchy = even more complex. Maybe a better solution could be to add an optional $flags parameter to = the existing is() methods, something like? isPublic(ReflectionProperty::GETTABLE) isProtected(ReflectionProperty::GETTABLE) isPrivate(ReflectionProperty::GETTABLE) isPublic(ReflectionProperty::SETTABLE) isProtected(ReflectionProperty::SETTABLE) isPrivate(ReflectionProperty::SETTABLE) isPublic(ReflectionProperty::GETTABLE & ReflectionProperty::SETTABLE) isProtected(ReflectionProperty::GETTABLE & ReflectionProperty::SETTABLE) isPrivate(ReflectionProperty::GETTABLE & ReflectionProperty::SETTABLE) #fwiw -Mike > I guess it depends on how it's handled. If all property handling is = updated so that "public int $number" is identical to "public:get = public:set int $number", there's no issue, but if we treat those with = separate visibilities to be additional, it probably makes sense to be = somewhat separate. >=20 > While isGetProtected() is technically false for "public int $number", = if it's not inferred, it's semantically incorrect. A good example of = this is ReflectionMethod::getPrototype, which throws an exception if = there's no prototype. Although this is somewhat bizarre, it is at least = a thing we do. >=20 > --- > Best Regards, > *Ollie Read* --Apple-Mail=_751442BB-B431-4C55-B29F-3BB6DF336F8F--