Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116833 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 85114 invoked from network); 6 Jan 2022 16:04:10 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Jan 2022 16:04:10 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 54C20180511 for ; Thu, 6 Jan 2022 09:11:55 -0800 (PST) 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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,MISSING_HEADERS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 6 Jan 2022 09:11:54 -0800 (PST) Received: by mail-wm1-f47.google.com with SMTP id k66-20020a1ca145000000b00345fa984108so1558788wme.2 for ; Thu, 06 Jan 2022 09:11:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:cc:subject:user-agent:in-reply-to:references:message-id :mime-version:content-transfer-encoding; bh=+F2Psz9ur3ILG9UE9JH31QwdKUMPKjXlQjMS5FQcMg4=; b=eE5efIs/UnqR0TTr3PuwWHz/ooUxrdrXQ7ZEzwpnY/JxV1mHuyDrLZ80wlWeQ/Tj6m jWN19T+Eh9duOUpBMJtjt1JtSN8oKZIqQd3bLqgK9XFixf3fFygQoebp9irqMaETkN8s um/LKNAbryehZV5b82yieJIIRjrcLpkI/XXrihLHjIgY+DM1D0d2msbMLzph6dteMURW nKHzeCk3NvgMDBg5qa23opMWwcBmXUwiLh5qhBMvzx5axBYbUh571+tnKrmHHrkY6DfN titgkCkcRKUDXiY2RFYWU4n6vvsK/o0Fv6qdl0DIYhHucJ4Yx+ql6rg1eJKoIKEDgLsC /7jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:cc:subject:user-agent:in-reply-to :references:message-id:mime-version:content-transfer-encoding; bh=+F2Psz9ur3ILG9UE9JH31QwdKUMPKjXlQjMS5FQcMg4=; b=PU9cSuIuf8i9N9s4aGCifRK5TBx3rYc4fRTHjHX92oeHeEL/+FYiBwniKlGKgzgaif n0dLIJ5xI/Pj5y6XbfT3XqVC6I1d50JOIcim/QAGtFF24kfX8nuXgYLOF4sVzOni6ciq iGHLQRqj60EhHI2gOZ/DkeMwtfgkCx3WlTS+kLZni8beOE9WJCUL5uFWt7T9QQn8kSLu Lk8WCHHV0SximyCVkf2dp0+6KSrgIjoD1DcEcmiym75vCEI4InR7FLYOAahk5rOksbEc 5TYWXzSdmsoqc/WEZQq+VKXGsSR6ZIQqWYBexR2HOSLVEPB522rDaL7uvjmVz1u87tFf qNVg== X-Gm-Message-State: AOAM533q/bqNiVl3WN5quNikRI21Te6tKoVnk2EDLfnAWNVP97/znik2 rl8+VTzgOjTCiMMbHSTBsOxDjRAVO+M= X-Google-Smtp-Source: ABdhPJwo1spKjmN603mu582/cQ/mhjw679kS38Bh1DRIHk63mlz2h1OPq64LbLyNEVDKbI9YIp1sLA== X-Received: by 2002:a05:600c:4ed3:: with SMTP id g19mr7843137wmq.195.1641489113709; Thu, 06 Jan 2022 09:11:53 -0800 (PST) Received: from [127.0.0.1] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.gmail.com with ESMTPSA id a3sm2884124wri.89.2022.01.06.09.11.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Jan 2022 09:11:53 -0800 (PST) Date: Thu, 06 Jan 2022 17:11:50 +0000 CC: internals@lists.php.net User-Agent: K-9 Mail for Android In-Reply-To: References: <1641335738.195767637@f174.i.mail.ru> <5a4aebf8-e592-4517-8930-d18b112ef1fd@www.fastmail.com> <5a99809d-afda-546c-5a11-a4f0f821aa37@korulczyk.pl> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] RFC: Trait expects interface From: rowan.collins@gmail.com (Rowan Tommins) On 6 January 2022 16:25:04 GMT, Chase Peeler wrot= e: > I think the advantage would come within the trait=2E If I say the trait >expects an interface with two methods, then the tool can act as if the >interfaces methods exist in the trait even if they aren't explicitly >defined=2E As others have pointed out, though, you can get the same behav= ior >from declaring the methods not implemented in the trait as abstract=2E This is where I wonder if people are talking at cross purposes=2E=20 The *only* advantage I've understood of the proposal is to save on copy an= d paste of abstract methods from an interface into a trait, and everything = else is just restating that in more complicated ways=2E So, yes, static ana= lysers could use the information about requiring an interface in exactly th= e same way they can already use abstract method signatures, to validate the= trait itself - but that wouldn't be any *easier* for the tool, and in fact= would be extra logic for them to implement, so it seems an odd thing to br= ing up=2E But some comments seem to be hinting at some *separate* advantage, to do w= ith "correct usage" of the trait, which I haven't grasped=2E It's possible = that the mention of static analysis relates to that in some way, and I'm ju= st completely missing the point=2E Regards, --=20 Rowan Tommins [IMSoP]