Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101954 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68889 invoked from network); 4 Mar 2018 22:32:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Mar 2018 22:32:12 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.171 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.128.171 mail-wr0-f171.google.com Received: from [209.85.128.171] ([209.85.128.171:35120] helo=mail-wr0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CA/B3-29690-9E37C9A5 for ; Sun, 04 Mar 2018 17:32:11 -0500 Received: by mail-wr0-f171.google.com with SMTP id l43so15388239wrc.2 for ; Sun, 04 Mar 2018 14:32:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:cc:from:message-id; bh=x/uvIVgcR3a7+Q6cv7Ge9V5GSObyeprMXiW3rMahPqg=; b=VMASHwNx7Mn8G1YeFWuaV/o3mS41YonBt6SclvzE3cooHvj5jHO4cjPxMsM0mtWRFp romqnj42fVdOnnxnk63HqFd9FMfqLXO6wunx/88GiVCSiDxZ05bcRqlh3XcmrNmac8ge Rjb/whCcsVi6+hTF0fRXOSYqWGUAIrjdWpfdjQsvK3JRK3FrxQKQw48Bh09MlV9yhZGd f8hfsuAswFwh3ayMkdpG3qWHoHIn9+P4iWzcUlmztnfcdVinSXEVh+d0wa0ErGtp9iKf flVCPbXqRgLVkC2ibEX8RsN/O1fxUYaSuNDIYMTKoLZCOn+AYbAHzE1mN8oKMYPl1lAT rO+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:cc:from:message-id; bh=x/uvIVgcR3a7+Q6cv7Ge9V5GSObyeprMXiW3rMahPqg=; b=E+zpCkFprwEJ8C/njZhWK8+CeXlY65cksl8UK57B+tGZEXbJxobmtmEdKfPtOfnXp0 JAjsA6C/JA3IbeMWBHRJnkRzW4EK8FxaUj495QFM1u5UvmUszQEUhsI2Xjel8wpfffUx 6SL/GQEGldBkM+c74oyh1kBFXfZHMKmOboxozHJe/k1F+YsxrTULN+47SeaL0oSlmztV grwl6Lox0CPIeAOq/c5dwJIWEXDY5W0aZyNNEclJls5/yHMTu0V7/26p+iIl4T3Bzi1+ 7qcDwaFmomN7LPpZa7gNLK20hiJpdWSJ8f2T1VIaGe7ScsswWrTypF6qQQvsZcdXc7pf hWWQ== X-Gm-Message-State: APf1xPBKtG3dY1dfQDiWKhCULf5iyyaUiwrvsUhs6nVP86M2Gs0JQA+7 QIc8n7QE0Hul9Hfn/GlqwSJ0fg== X-Google-Smtp-Source: AG47ELuIpaeNXYRdaET9uZyIx7KxTSdHUOpWjJP67ubkg1Fv8w7zUgEHCNQ+BuQ9VJ+lh9K5O0xA5Q== X-Received: by 10.223.195.206 with SMTP id d14mr11739737wrg.0.1520202726827; Sun, 04 Mar 2018 14:32:06 -0800 (PST) Received: from android-c07b90b023759a5a (host31-52-120-114.range31-52.btcentralplus.com. [31.52.120.114]) by smtp.gmail.com with ESMTPSA id h50sm22314924wrf.65.2018.03.04.14.32.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 04 Mar 2018 14:32:05 -0800 (PST) Date: Sun, 04 Mar 2018 22:32:04 +0000 User-Agent: K-9 Mail for Android In-Reply-To: References: <71120afe-503a-c83b-debd-a7913192d80f@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable CC: PHP internals Message-ID: Subject: Re: [PHP-DEV] Traits with interfaces From: rowan.collins@gmail.com (Rowan Collins) On 2 March 2018 01:38:37 GMT+00:00, "Pedro Magalh=C3=A3es" wrote: >On Thu, Mar 1, 2018 at 11:04 PM, Rowan Collins > >wrote: >> >> What *can* break an interface's contract is changing the *visibility* >of >> the pasted method using "as protected" or "as private"=2E This would >need to >> be captured somehow while composing the class, probably producing a >> compile-time error, just as an explicit "implements" declaration >would=2E > > >To add to that, the receiving class can simply replace the trait >method=2E True=2E This feels closer to normal interface / inheritance checks though:= you've explicitly written a method that violates the contract not used a t= rait-specific syntax or feature to do so=2E >Currently, not even an abstract method on a trait enforces anything on >the >receiving class=2E See: https://bugs=2Ephp=2Enet/bug=2Ephp?id=3D75449 The way I see it, the Trait in this proposal isn't enforcing anything, it'= s just pasting in the "implements Foo" clause along with the extra methods= =2E Whether the result is valid is up to the receiving class, and there's a= completely separate requirement that the Trait itself matches the contract= =2E >With that said, I have started some work on "Implicit Interfaces"=2E I'm not sure I like the sound of this, but I'll leave that to its own thre= ad=2E Regards, --=20 Rowan Collins [IMSoP]