Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92952 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88007 invoked from network); 29 Apr 2016 16:57:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Apr 2016 16:57:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=derokorian@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=derokorian@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.174 as permitted sender) X-PHP-List-Original-Sender: derokorian@gmail.com X-Host-Fingerprint: 209.85.214.174 mail-ob0-f174.google.com Received: from [209.85.214.174] ([209.85.214.174:34810] helo=mail-ob0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2D/61-26386-76293275 for ; Fri, 29 Apr 2016 12:57:12 -0400 Received: by mail-ob0-f174.google.com with SMTP id bg3so58365262obb.1 for ; Fri, 29 Apr 2016 09:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=jQ8zQvzcDqmoLmYhZYLJiq8zqT81WW9uEQywLCQYsts=; b=jb3jI/d7WTlI1mxuyKiD6xYAV1/uYWmmW0fUDKoL/p2xWCNlp5iH0tpoqoQNKbV5iP 1wIuxY+YjJ7dG5BBNDepDlLtVNHDVwjFK1brMIECmqlRGeBij67K6qpzyUI0SuAGYJoA 7qBruGvJJJIn/Re+DyjMH0h63RJzM2sHyMUpL/B/g9HusYkDSuQjrkJHO/57iJClS4sS 4wBRqQfvzGFlOW9b7uSAEpIdMsHoNWN9CSpjeAJEtlqzHnvw0NglatzkwQPk+MeLoW8E tcuGA9tY56HX9BigzmKovQ3S3Ejglvqaxn8cszpJq3u0COTFHD2N+BbLdyka3OEhubjt 9MgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=jQ8zQvzcDqmoLmYhZYLJiq8zqT81WW9uEQywLCQYsts=; b=EXyneC0Inv/l64vOO2hZd3WdfgR2jljUjNBdkSMjm6EJsEk+fkhUwYcK1wQdq3j7Dh /ykLQmZ/teQSEbavBwT5VjjKG330JOWylYVqnz1vnB5jI7QeoB5zrRReGjoXugWzCuzg ovwbhBUeItUnS6qLZ2I0W+9YeagewU4WuBgCTqbfHdomius3r36yd8dTEE8Tke4N9f37 jPECX8ZFmkLMCSNcwZ+vU6Q1DsjZWVVDLqmXWGN/p1xZIVlaygRpk3R+GcJrh7TGa/Wt exsE7ko+UEYeMLIcaEdlK2YMISZ7YxAsIYVrpg27LyBRb3cveyh4EfnxqJC87rw5HSQE yyOw== X-Gm-Message-State: AOPr4FUs4QrQtY/QRmH4ByZtDqJjDkUfUArW1KCT5kq+F8baQYg6RB8WTQD05xMo07jrveFLg1y9avsJ5vl0CA== MIME-Version: 1.0 X-Received: by 10.60.62.6 with SMTP id u6mr10392443oer.35.1461949028570; Fri, 29 Apr 2016 09:57:08 -0700 (PDT) Received: by 10.157.41.73 with HTTP; Fri, 29 Apr 2016 09:57:08 -0700 (PDT) In-Reply-To: <572390DC.1020108@lsces.co.uk> References: <5720A6B4.4000307@lsces.co.uk> <5721B9DD.3050300@lsces.co.uk> <57231ADD.9040006@lsces.co.uk> <572326A3.7000809@lsces.co.uk> <57234D3D.1070602@lsces.co.uk> <79c9df57-ee45-f415-3172-95f8229bbece@gmail.com> <57235F20.5080707@lsces.co.uk> <43b9c67f-3ec7-bacc-2608-552abbd1a3fa@gmail.com> <57237B36.1070301@lsces.co.uk> <0d71618b-2ffa-7273-f9b9-aeabc35f4211@gmail.com> <572390DC.1020108@lsces.co.uk> Date: Fri, 29 Apr 2016 10:57:08 -0600 Message-ID: To: Lester Caine Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e015384be8722f60531a288f6 Subject: Re: [PHP-DEV] PHP Attributes -> docBloc alternatives ... From: derokorian@gmail.com (Ryan Pallas) --089e015384be8722f60531a288f6 Content-Type: text/plain; charset=UTF-8 On Fri, Apr 29, 2016 at 10:50 AM, Lester Caine wrote: > On 29/04/16 16:42, Rowan Collins wrote: > > function foo($a) { > > if ( $a < 42 ) { throw new Exception; } // Must not reach The Answer > > ... > > } > > > > vs > > > > <> // Must not reach The Answer > > function foo($a) { ... } > > The first version is my current code base, although it's unlikely to > throw an exception, more likely to have already validated the data > before using it so the check is redundant as it is already in the code > to handle the problem data. But in the second example just where does > the error redirect traffic? At least with in-line checks you control > flow ... but just how do you add a range? Does that need different > 'test' elements? > > My main target here IS to add a reliable mechanism to allow every > variable to have it's own validation attributes. The only current route > is as php-annotations nicely provided and which dovetails nicely into > the existing documentation process. Simply adding comments in line is > useless for the on-line documentation, and it's adding these annotations > to the documentation in parallel with making the data available in the > code which I'm trying to address. TRYING to find this even if it is > commented in the code on 15 year old code is a problem, and being able > to ADD docBloc annotation which can then be used later provides a > practical way forward. > > I've no problem with an alternate annotation method ... as long as in > PHP7 it is optional ... but I don't think this 'in-line' approach is > ACTUALLY the right long term solution to data validation. > But his RFC is about adding meta-data, which can be used up to the USER. The language here is providing no validation, just a means of defining metadata, which may in the future be expanded to some built in annotations. Validation is not specifically the point of this RFC, and the fact that a system could be built to provide this validation using the meta-data this RFC provides, does not limit it to that scope. > > -- > Lester Caine - G8HFL > ----------------------------- > Contact - http://lsces.co.uk/wiki/?page=contact > L.S.Caine Electronic Services - http://lsces.co.uk > EnquirySolve - http://enquirysolve.com/ > Model Engineers Digital Workshop - http://medw.co.uk > Rainbow Digital Media - http://rainbowdigitalmedia.co.uk > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --089e015384be8722f60531a288f6--