Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82060 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12975 invoked from network); 6 Feb 2015 18:59:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Feb 2015 18:59:36 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.181 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.181 mail-vc0-f181.google.com Received: from [209.85.220.181] ([209.85.220.181:41967] helo=mail-vc0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EC/8F-45146-61F05D45 for ; Fri, 06 Feb 2015 13:59:35 -0500 Received: by mail-vc0-f181.google.com with SMTP id im6so1128631vcb.12 for ; Fri, 06 Feb 2015 10:59:31 -0800 (PST) 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:content-type; bh=u4urAHEqzJuREhkmGeB8dCFTPc6B6pi8EppP2l4/R7U=; b=GBUBUyxXixsgSK/tANTfjY9n40dVAj7x8X3EZPB8irCA4OB3QOl6eU2t36gS/lxln2 Hg2dCvGPeNWoLIMPQtC75Xg6ul9wZascnEiKNxUxE60zou7cmn85IrgzL8YIWizKvrFi BW5WsT8/LpwTAXnrcVGgkSfPuCVAJm32p4FMAy8F+TZ3LlzlI6i6a2D5KtZBDVkjHon9 J1T1TKruBapWmblPcbJhiyWh03LHKsJx0s319SBznplBB+SEKVehxrKtdee+ssKu3XSg 3z/vF41nULQMnYugytUVfgU7IpQG9v5KzGq+njd4uhBsmCl+nI3PwQ7DiiYJr7av6Vhw +iDw== X-Gm-Message-State: ALoCoQmABhLrlTkI2L8/88zXTQec6f//tSuQjjRSCV9SIsUB9yemn4NMQ/Xib7pnZikocCfJFMiyNK45LQw2OiYAjFO8OCDyKTIhc9rxggyndhGy565f7/TMLz3C6jqbX1uuJmSFhET84Tlhjyqlit4Twa9rFH0YkA== MIME-Version: 1.0 X-Received: by 10.221.44.65 with SMTP id uf1mr3339497vcb.46.1423249171460; Fri, 06 Feb 2015 10:59:31 -0800 (PST) Received: by 10.52.74.73 with HTTP; Fri, 6 Feb 2015 10:59:31 -0800 (PST) In-Reply-To: References: <54D37D41.2030706@hoa-project.net> <54D470FA.6000303@hoa-project.net> <02d301d041f3$0c5f3990$251dacb0$@tekwire.net> <031501d04217$b393bff0$1abb3fd0$@tekwire.net> <54D4FFA4.3010703@birkholz.biz> Date: Fri, 6 Feb 2015 22:59:31 +0400 Message-ID: To: "guilhermeblanco@gmail.com" Cc: Dennis Birkholz , PHP internals Content-Type: multipart/alternative; boundary=001a11c3ea3c4acee9050e70059b Subject: Re: [PHP-DEV] Design by Contract From: dmitry@zend.com (Dmitry Stogov) --001a11c3ea3c4acee9050e70059b Content-Type: text/plain; charset=UTF-8 I may give my opinion, but it's going to be only mine. May be it's better to write all these question in RFC and make everyone to expose their opinion. It shouldn't be a final voting, just a survey that would help us make a decisions, where to go. don't dive into implementation details, use cases, syntax and behavior are more important. Thanks. Dmitry. On Fri, Feb 6, 2015 at 9:21 PM, guilhermeblanco@gmail.com < guilhermeblanco@gmail.com> wrote: > Hi Dmitry, > > So, can we start drafting out some things? > Simple questions would help everybody to get this moving forward. > I'll compile a simple list of questions to answer that would drive the > direction on how it would be implemented. > Please ignore the formatting on HOW they are defined. Tokens can change. > Here it is: > > 1- Doc comments vs. outside? > > 2- Keep object instance creation the same? IE: @Foo vs new Foo() > > 3- Is constructor the only way to inject parameters? > > 4- What if we have optional arguments, like: @Foo("bar", null, null, > "woo")? > Suppose that you wanna fix the optional arguments by declaring names (like > this: @Foo("bar", test="woo")), doesn't it collide with PHP interests of > not supporting parametrized arguments? How would parameter skipping > proposal address this in a nicer way? > > 5- How would you deal with inheritance? Should a method inherit the same > annotations from parent or not? > Should we add ability to flag to inherit or not? What about overrides? > Would they be allowed? Is there a vague idea on how this concept could be > achieved? > > 6- Would you be possible to change annotations value at runtime? > > 7- Would we validate annotation arguments at all? Consider as array? > Properties of objects? > > 8- In case we take the approach of properties of objects... how would we > flag that a given class can/cannot be used as annotation: another > annotation, interface, any other idea? > > 9- Would we and/or wow would we flag that a given class could be used only > in a class and not in a method? > > 10- How would it be the syntax to declare a new annotation? > > > I think we have a good start now... =) > > []s, > > > On Fri, Feb 6, 2015 at 12:53 PM, Dennis Birkholz > wrote: > > > > On the other hand you have a working solution. > > > You won't be able to use annotations for PHP5 projects anyway. > > > Except, if we put them into comments or doc-comments. > > > > > > /**[Attribute(Value)]*/ > > > > Why not /**@ Attribute Value */ or /**@ Attribute(Value) */? No [] > > required and @ looks more familiar with docblock annotations in use. > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > Guilherme Blanco > MSN: guilhermeblanco@hotmail.com > GTalk: guilhermeblanco > Toronto - ON/Canada > --001a11c3ea3c4acee9050e70059b--