Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112080 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 53214 invoked from network); 20 Oct 2020 15:57:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Oct 2020 15:57:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A95351804C3 for ; Tue, 20 Oct 2020 08:14:09 -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 autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (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 ; Tue, 20 Oct 2020 08:14:09 -0700 (PDT) Received: by mail-io1-f52.google.com with SMTP id q25so3898016ioh.4 for ; Tue, 20 Oct 2020 08:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=XLObDtmlGj9h6dcOObHstoq5Pn0FwRqvhEueGIKu+AM=; b=ZdwYzsZVGF1cEox+l0LJJy57S4nWF9eEO5cy13Ke7ddUm+aSBeG+WVDsWRTGdL0uzB 3lqGvzlyXyEycUigFEXbmRAFA/uyDhKgnZAB9JpVGyoFt0wHSROqimhxiCH1MVqxJgkT YJim3NnX8p+zEvL041/20LlCwmvFSGD4Ky/Ou+k7CZY2kHaTjHOLUFLWrU4up0wuPVve 9V6iojnf9t+NvELuSUSuJVbw0+Az0A/dysxWdbaSKsbuOAGfzPX48cSPvC0jkilkK1L+ 40PAmnqs4/Zb4MPLKfBcIcbg70efsUJKyg/Eg15irqIvftB9Ud92HOIJfNQFKicEe/sv xDPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=XLObDtmlGj9h6dcOObHstoq5Pn0FwRqvhEueGIKu+AM=; b=ft0GC+D8lIZa2ifArxtSUmj256fRtrBVx40ZDZWff9eyhHwcgY6MzJzkYtzpjIy2+l KTPWgP+Tzod2e4PicZu7kqSjbLVmCnSp87D63OhCLZoiC8edFYi3vZcR7zYJQPx7OxUG bHon8WPr0Y9fmHCUD++qNJk6LN2AbpafbE6Da5HXn2FM2A32wCTCfMh7dHsBGy/3nfGR azu/Lhs2pdjkBlvnAQXyo3aIShD3dGKAgk8VTODO+QE/oanz517uMT/DSfv8a0ceWyV3 9CVvsJVNj4ksU2bgd9xoo6BsgO9RzfRjKAortgWMoRUQ9kYcOke8BcXtZpmYOky97/h4 VDKg== X-Gm-Message-State: AOAM532Pt3EX1oj+h3VrDwjjUgCME3BMNAFBdNgD1seQR6xrzWEnYsd2 Chocg16BU6uO4HGJ0bkgijCO0YaiD+o6zdP90o2Cn0YTjjM= X-Google-Smtp-Source: ABdhPJygB1BGRuK3U+PQFzBFyPcVv4oYn3UwMZ5G0ZAgNWAIszeYPPA/2uJyveMkyDwUO02Q+gZJxFTm7Stt2iqvgKQ= X-Received: by 2002:a6b:f909:: with SMTP id j9mr2579408iog.184.1603206847402; Tue, 20 Oct 2020 08:14:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 20 Oct 2020 16:13:55 +0100 Message-ID: To: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000a4188105b21bae5f" Subject: Re: [PHP-DEV] List of attributes From: rowan.collins@gmail.com (Rowan Tommins) --000000000000a4188105b21bae5f Content-Type: text/plain; charset="UTF-8" On Mon, 19 Oct 2020 at 16:17, Theodore Brown wrote: > > In theory nested attributes could be supported in the same way with > the `#[]` syntax, but it's more verbose and I think less intuitive > (e.g. people may try to use the grouped syntax in this context, but > it wouldn't work). Also the combination of brackets delineating both > arrays and attributes reduces readability: > > #[Assert\All([ > #[Assert\Email], > #[Assert\NotBlank], > #[Assert\Length(max: 100)] > ])] > I think you're presupposing how a feature would work that hasn't even been specced out yet. On the face of it, it would seem logical and achievable for the above to be equivalent to this: #[Assert\All( #[ Assert\Email, Assert\NotBlank, Assert\Length(max: 100) ] )] i.e. for a list of grouped attributes in nested context to be equivalent to an array of nested attributes. Unless nested attributes were limited to being direct arguments to another attribute, the *semantics* of nested attributes inside arrays would have to be defined anyway (e.g. how they would look in reflection, whether they would be recursively instantiated by newInstance(), etc). Regards, -- Rowan Tommins [IMSoP] --000000000000a4188105b21bae5f--