Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92932 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42830 invoked from network); 29 Apr 2016 12:49:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Apr 2016 12:49:37 -0000 Authentication-Results: pb1.pair.com header.from=kontakt@beberlei.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=kontakt@beberlei.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain beberlei.de from 74.125.82.52 cause and error) X-PHP-List-Original-Sender: kontakt@beberlei.de X-Host-Fingerprint: 74.125.82.52 mail-wm0-f52.google.com Received: from [74.125.82.52] ([74.125.82.52:36295] helo=mail-wm0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5E/C9-26386-06853275 for ; Fri, 29 Apr 2016 08:49:37 -0400 Received: by mail-wm0-f52.google.com with SMTP id n129so26405337wmn.1 for ; Fri, 29 Apr 2016 05:49:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beberlei-de.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=Uwp0rvxNEg2iwrZhHIN8TyEW2M02nUKI0uoQI9dp1+c=; b=j/+IUPWJJr8GfsdB5402eXZExs3ujKm7IE+/o+H1gb8M7Q936BG/uv4LM8eM/8MvOz 7h/bUi35mPJQ4p3BAnQYADAJwbbfLTYJSmwfW8mYJ0pOBw/08XDFfLnCjZo55Z6ITHAP zFWKx3Mfb5U0e7T+7YyjCCFO6Jhx4BxVgo8k6GzIYJPgxxFwlxVNlprEamkSrw+UuwWn dCv3LpVCCRSYKcMCUtTd/8RGeUsI/KA4poxAz4EKr1VCzy2WJREoXBr+0xLkykcr4j+/ i/vpT3ODMA8nIYIlXXRtvAIEc1GvMWHoePHUYAkWfshv/zEsaiXfTlr/AUwfvPgraJE/ IgwQ== 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=Uwp0rvxNEg2iwrZhHIN8TyEW2M02nUKI0uoQI9dp1+c=; b=FeEaseBGbUMkOfIK0Tyk+lIbU9EW+Zq4FyojfQCfVunrdEnBp4JvOZ3ymACcvwVIHX hOPSxqGjRO9lCCxGkuEYQ/x9wK7U5Fe0VURVIfKAx6QqmLGGEToCx0VpxWSb8cLWml5f HjJGYwL84H4lQp3AGsmlZsL366RgKsb7PwqAt55ixWxkzeA0xlFjE/3CkOYI1fdK5DgI gAkK2QeY0VLD5Pt+nvpVwR4i1O5WAERAFaz98ppy6pS0u9vJ7vUIf7HDcQN2jeQ3teKf kM99S7OwpJNE7GqYw3nXKI22zxF7T1Aed2AiaqXOzZSmyCcg9haH1y//Zl5FRDEzh7Ou qBNw== X-Gm-Message-State: AOPr4FW6FC8wW7xdGHfIIr5WgKn7I/86uXIAeZBeiGHIhlHQpwcKkAD1ZLWv1mxEoFnYNum1ubgDtSYNdlIqNg== MIME-Version: 1.0 X-Received: by 10.28.141.18 with SMTP id p18mr3749540wmd.57.1461934174161; Fri, 29 Apr 2016 05:49:34 -0700 (PDT) Received: by 10.194.94.163 with HTTP; Fri, 29 Apr 2016 05:49:34 -0700 (PDT) X-Originating-IP: [5.147.248.10] In-Reply-To: <79c9df57-ee45-f415-3172-95f8229bbece@gmail.com> 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> <79c9df57-ee45-f415-3172-95f8229bbece@gmail.com> Date: Fri, 29 Apr 2016 14:49:34 +0200 Message-ID: To: Rowan Collins Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a114700fa22eba305319f13f8 Subject: Re: [PHP-DEV] PHP Attributes -> docBloc alternatives ... From: kontakt@beberlei.de (Benjamin Eberlei) --001a114700fa22eba305319f13f8 Content-Type: text/plain; charset=UTF-8 On Fri, Apr 29, 2016 at 2:36 PM, Rowan Collins wrote: > 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. This. Lester, nobody wants to move phpdoc out of the *doc* comment. Its still documentation. It will stay,. We want to move the "annotations" out of the docblocks that are evaluated at runtime for configuration. Thats two different things. That is what the attributes RFC is for. > > > Regards, > -- > Rowan Collins > [IMSoP] > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a114700fa22eba305319f13f8--