Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92931 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35206 invoked from network); 29 Apr 2016 12:38:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Apr 2016 12:38:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.41 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.41 mail-wm0-f41.google.com Received: from [74.125.82.41] ([74.125.82.41:38891] helo=mail-wm0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7D/18-26386-AC553275 for ; Fri, 29 Apr 2016 08:38:35 -0400 Received: by mail-wm0-f41.google.com with SMTP id g17so34110867wme.1 for ; Fri, 29 Apr 2016 05:38:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=ENXoMpgULXuvKlknCydhMSA/HyzX4iIErJZonVazryg=; b=OF4e+bRgMYmMwIlu1mQlOggTIzonRMqWzfuZPXM9+klzhjIxEm4LMqq7FQqpA9cmud MrVtb5bTe+HHAwrqfXNbrUeZU7ntWq3gMd7qIAWOgQkOxg90GiIXq9Jc0Klx9SHqMTw2 cJ0luoJwt6o0UaIeQuqyfMZNo8TD5CDOXeH9dc3WmabA0zbtcMBkvPhmr6TjQpujBg+x WXvgDyKj4+rSvZtuvabwG27g5k8s8oBVOPRnP7jy8TzR/iqDolaY3liTq07ge1rNqcyq 1+l5TmMb0nOatT9AXEjibwM5rSbwiQBXi7VUpg2XbeK6711/6R/NX9Pt4gM45oJCdMyj qNMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=ENXoMpgULXuvKlknCydhMSA/HyzX4iIErJZonVazryg=; b=IlxKwiT7a6m7eR4oyFiQv8kauh19d3bZP2svjsk6M568tH5DZSDiMAMMqLvlDU6Ir9 SoH9if0cZUb3egMr13BLb8WlCQZddMd9yT3rHQvl3gEegakCn78/HTkigXJac4h7Bdei Eft1m6LRWId46Ve6jYzPwzCZGmYeqNWGjsETzsYnkHEwnrFdb+6JsAv0NMj0Lrblej0/ qnKo00ZZG/GeZ23dxDnEj9Aiil1SmzTp8oJYi03wmnizjYgOIFNvrQHRnuOkefrWLXYd Kb4j40UZF6VUOMEXpyyse/q7QanNyg9h79u+1XkdDqh1qpBiP7KXq3BDAsl8+l9RSs0t qB3w== X-Gm-Message-State: AOPr4FV2lDxXjm3ZBKnKsxjLFAMKXsGybDZzwV5gPY8ndb7oiamo8Ch7pP1F45DRmshzKQ== X-Received: by 10.28.170.194 with SMTP id t185mr3870200wme.91.1461933510756; Fri, 29 Apr 2016 05:38:30 -0700 (PDT) Received: from [192.168.0.82] ([93.188.182.58]) by smtp.googlemail.com with ESMTPSA id i3sm14608229wjx.30.2016.04.29.05.38.29 for (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Apr 2016 05:38:30 -0700 (PDT) To: internals@lists.php.net References: <571DCA6A.2070803@zend.com> <571E35D8.8080504@zend.com> <571E4A83.3080304@garfieldtech.com> <571E64A2.2040505@gmail.com> <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> Message-ID: <79c9df57-ee45-f415-3172-95f8229bbece@gmail.com> Date: Fri, 29 Apr 2016 13:36:06 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <57234D3D.1070602@lsces.co.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PHP Attributes -> docBloc alternatives ... From: rowan.collins@gmail.com (Rowan Collins) Lester Caine wrote on 29/04/2016 13:02: > In my book this is DIRECTLY relevant to the current discussion! > > We have been adding attributes via docBloc annotation since PHP4 days. > This has partly been accepted as the default way of doing it and phpDoc > was originally part of the PEAR support structure. A large section of > legacy code has well written phpDoc annotation and simply adding the > current requested attributes to that platform creates no work in the > core code. I think there is a misunderstanding here about what code attributes/annotations are for, and it's understandable given current practises. For instance, you might see a block that looks like this: /** * This is a very cool method. * @param string $input A stringy thing * @return boolean Success * @Magic(42) */ public function foo($input) Here we have two tags for generating documentation (@param and @return) and one intended to be accessed via Reflection and add some special behaviour (@Magic(42)). It is only the behavioural tag that we are discussing when we talk about "attributes/annotations". In Java, the same block would be in two different parts: /** * This is a very cool method. * @param input A stringy thing * @return Success */ @Magic(42) public boolean foo(string input) Or in C#: /// /// This is a very cool method. /// A stringy thing /// Success [Magic(42)] public boolean foo(string input) Note that the "Magic(42)" uses different syntax, built into the language, while the documentation parameters stay in comment syntax, and are mostly just a convention followed by documentation tools. This is what is being proposed for PHP: /** * This is a very cool method. * @param string $input A stringy thing * @return boolean Success */ <> public function foo($input) Thus the behaviour of docblocks is not going to change, and reading their content remains the responsibility of whatever tool you use to generate documentation from them. The core code has no responsibility for defining them, and cannot force the developers of documentation generators to treat them in any particular way. Regards, -- Rowan Collins [IMSoP]