Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120735 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 21325 invoked from network); 3 Jul 2023 12:21:59 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Jul 2023 12:21:59 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DF93C1804F2 for ; Mon, 3 Jul 2023 05:21:58 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, 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-yw1-f179.google.com (mail-yw1-f179.google.com [209.85.128.179]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 3 Jul 2023 05:21:58 -0700 (PDT) Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-5774098f16eso41881247b3.0 for ; Mon, 03 Jul 2023 05:21:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688386918; x=1690978918; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=f4bbhplaKmQfKSjA76jsbOy+EVYMF90bJGF2dQlKjhc=; b=oRZZJ9ck5ptXoRmBF+DyTn7gUj0z1YoV9A3zzBPRy8Wb1dfwCF6lFeTOwBYk2/zfwA 235fdggOYpmPoYso3FcmbFXa2WEOkET14bSbAGyDqUsGTGds+sPy0mdAiWCNsnYaorkt wUSf+GlW1WYSMToKH+NEx+jto74DpHMnVRcL6yH5bC5JyBIrkdUkvHzUMwp31exohKKW YgRsQxyLVVvKmkWobOKt0ELpZKtc+CAYY9YfH/EgdslGSD5OB/qcLHncFUf8QeCK4dCl w/anSqitH/4f5QiPbQURtvhxpGRJ05ijZRWxlQ1iD7iG3L786S1H9bEh4P+yW/79SZIO xBnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688386918; x=1690978918; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=f4bbhplaKmQfKSjA76jsbOy+EVYMF90bJGF2dQlKjhc=; b=L2CQu2NKtm2DMoUndUwWSEHO92rExeHUoakvBjpyZjymiTRfRM85I4uJFtmQRn6+V8 1DuTadqkFWzofZp5d6uyYzSVm83qSs25ZRxIU+VD7MPqODEcJZVWpLYSgfr6WcuqqzDS k3xQVIHNt//8ByEQvIe7ZtR++xfGI8UuVJofiQebdl+4K8Y8yi68OomTMMiwGOR2LIEx C9fK/oNdh/pCBmrQdI1zKienMu4PJbSrpGrdPn8VEQpbWlKR+A0YYvRZUSHFLSsMXAN4 KIu1FFZBA5Hex5NAhUz43hZdUWNuISFe+LV82Z/uPqRuv/DsfrlhN/BBZr0kKc01Oicd sNOg== X-Gm-Message-State: ABy/qLbKjhShPnGnXmktGuYvhnnvJPbl98I2s0BV9XG40mQhhz+QDBDy I6JU/RJw4jjOncFEByxaUeRrdW8FWP0Q2RGezKjDpIFgSdY1h8LA X-Google-Smtp-Source: APBJJlGlGbGXKaAtjQEtiQ+3pIbmtPslGixs1RSGddonu8isZaoBYaqbTc7KcOgknU5OnaJOt6XUCowoVcQ+eEr/r7s= X-Received: by 2002:a25:abc1:0:b0:c3a:8530:c8ab with SMTP id v59-20020a25abc1000000b00c3a8530c8abmr10355397ybi.2.1688386917625; Mon, 03 Jul 2023 05:21:57 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 3 Jul 2023 14:21:46 +0200 Message-ID: To: Pierre Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="00000000000077f9d205ff9436a6" Subject: Re: [PHP-DEV] [VOTE] Interface Default Methods From: michal.brzuchalski@gmail.com (=?UTF-8?Q?Micha=C5=82_Marcin_Brzuchalski?=) --00000000000077f9d205ff9436a6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable pon., 3 lip 2023 o 13:50 Pierre napisa=C5=82(a): > Le 03/07/2023 =C3=A0 13:32, Micha=C5=82 Marcin Brzuchalski a =C3=A9crit : > > I voted "yes", my personal use case waits for this feature. My use > > case example: > > > > https://gist.github.com/brzuchal/89e9481bbd34a6ce3d95a68eabff038b > > > > With interface default methods I'd no longer need traits that implement= a > > single or in rare cases 2 methods that > > use their respective methods returning objects and iterate in Generator > > fashion over a paginated result set. > > This is not an issue if there is one implementation of the interface bu= t > > when I decorate to apply some: > > * caching > > * logging > > * failover > > > > then the trait has to be attached to every class besides that it has to > > exist which is an additional symbol here. > > > > Cheers, > > Micha=C5=82 Marcin Brzuchalski > > Please everyone yes to this ! > > I use Symfony daily, and the SomethingAwareInterface / > SomethingAwareTrait is very annoying, by having default method > implementations on interfaces, it would remove the use of having traits > at all. Everything would be much easier to read and write. > I agree, there are two interfaces that always require adding a trait in Symfony. These are NormalizerAwareInterface, DenormalizerAwareInterface They always require including NormalizerAwareTrait, DenormalizerAwareTrait. With this feature none of the above traits would no longer be required and the interface use would be less confusing. Cheers, Micha=C5=82 Marcin Brzuchalski --00000000000077f9d205ff9436a6--