Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92880 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53992 invoked from network); 28 Apr 2016 17:41:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Apr 2016 17:41:42 -0000 Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 212.232.28.125 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 212.232.28.125 mx204.easyname.com Received: from [212.232.28.125] ([212.232.28.125:41106] helo=mx204.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C4/45-28296-35B42275 for ; Thu, 28 Apr 2016 13:41:40 -0400 Received: from cable-81-173-133-226.netcologne.de ([81.173.133.226] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1avpwX-0004sw-4n; Thu, 28 Apr 2016 17:41:37 +0000 Reply-To: internals@lists.php.net References: <57211D05.6020002@fleshgrinder.com> <572130DB.3020503@lsces.co.uk> To: Lester Caine , internals@lists.php.net Message-ID: <57224B43.7010309@fleshgrinder.com> Date: Thu, 28 Apr 2016 19:41:23 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <572130DB.3020503@lsces.co.uk> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="O7EwXmewTADcOAeHxMhwqUvwkhxfB5TJw" X-ACL-Warn: X-DNSBL-BARRACUDACENTRAL Subject: Re: [PHP-DEV] [RFC] PHP Annotations VS Attributes From: php@fleshgrinder.com (Fleshgrinder) --O7EwXmewTADcOAeHxMhwqUvwkhxfB5TJw Content-Type: multipart/mixed; boundary="u9Vk5wCoqWvE9am9Txf5LnA2tSrIBt08N" From: Fleshgrinder Reply-To: internals@lists.php.net To: Lester Caine , internals@lists.php.net Message-ID: <57224B43.7010309@fleshgrinder.com> Subject: Re: [PHP-DEV] [RFC] PHP Annotations VS Attributes References: <57211D05.6020002@fleshgrinder.com> <572130DB.3020503@lsces.co.uk> In-Reply-To: <572130DB.3020503@lsces.co.uk> --u9Vk5wCoqWvE9am9Txf5LnA2tSrIBt08N Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 4/27/2016 11:36 PM, Lester Caine wrote: > To add to your list ... > https://www.phpdoc.org/docs/latest/guides/docblocks.html >=20 > The glossary entry is rather bare, but I would dispute THEIR statement = - > "but also influences the way the application behaves." >=20 > In my book, these comment blocks are 'annotation' is it's simplest form= , > and we add tags within that annotation to make particular details of > that annotation both machine readable and humanly prominent. That some > of these keys may be used to "influences the way the application > behaves." is secondary? >=20 It is totally secondary but still possible, hence, stating it is correct. A problem is the that attributes that were added via annotations are per definition not guaranteed to be executed (influence the way the application behaves) and are as such not a good fit for design by contract, validation, nor security checks. However, "per definition" does not mean that one is not allowed to model it in such a w= ay. On 4/27/2016 11:36 PM, Lester Caine wrote: > My continuing irritation is that while subsets keep getting discussed a= s > duplicate elements outside of the phpdoc wrapper, there is no provision= > for the annotations that would actually help data validation. >=20 Value objects are a better approach towards validation in the very core than annotations could ever be. Validation of user input should happen at the most outer layer to fail early. Validation of developers should happen via design by contract where we currently only have assert() at our disposal. --=20 Richard "Fleshgrinder" Fussenegger --u9Vk5wCoqWvE9am9Txf5LnA2tSrIBt08N-- --O7EwXmewTADcOAeHxMhwqUvwkhxfB5TJw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXIktGAAoJEOKkKcqFPVVrEbkQAJ5skWqWaFSGR+NrZ/0etWYP K5Yr/l0qj/NzYnd+481j+Hq+kxGpRQZC3n64HJQFExrOCpMRoM4CrhUKIqjUrY7B SKlfoh1WfZyYglZkFFrzslTTgA3rzlsyNt7PPZ594JWsSt10hOKPf9HNnJP9BkqE 3/TcUQobHFZYaU16c1vzAQQVZCBCj1ByX4+ZOiw+WPn9PXeZMJ/Cfkj11CdshW+z jyXLqHt3l+whQC0+aHiwrWMTZirK7BgpKBlmx2RaMhfrhh8ETPpK1BADTC1Kl8I7 mC/fkIM75RG+wuuKL1qMjxkyvPZJWIEVX00DzQcpLPHvxiEhu0lq1byfaZO5nLlH WKdtB9fB9VQS31+K6CI3f7/0jv+QzpDdYubToSopf9B9NkUTEFVL0MC8+rjklTEl 3bYNCSMrlj6ESXnGUp3kzoggimbzDZSnpsHMXCsD/bYxUA1107DVc5NUeC4Q6JeC J8KfHgBwgr04Mq8OtddJGxtHnLtdrrA8NlSJUdk2MTa0Ts55syLwjXkxkE10ncYh juKezTA2jGzTDBoZwE0CjDovgjXl746zd2H19Tb0IIymfF2tOym8KXVilJvCQINW srTMnGslwnS25y2w7cgS7zW/iKIOH08F4ExPGfCOe/OO9683Kbx4KzFJheSNS+P0 mZH248m2H4mjtSwolxgE =JeF5 -----END PGP SIGNATURE----- --O7EwXmewTADcOAeHxMhwqUvwkhxfB5TJw--