On Sun, Feb 2, 2014 at 3:46 AM, Sara Golemon <[email protected]> wrote:
> On Sat, Feb 1, 2014 at 6:06 PM, Benjamin Eberlei <[email protected]> wrote:
>> Imho HHVMs syntax has the massive flaw that you cannot use docblocks on
>> those properties anymore, which is not the case with this RFC. All other
>> things equal, this is why this RFC should clearly be favored.
>>
>> Also with typehints or - unlikely but possible - property-accesors the hhvm
>> syntax will become very verbose for the __construct line, wheras this RFC
>> can handle those cases without having to think about future compatibility.
>>
> Inclined to agree on the matter of getters/setters (though I regard
> the docblock issue as trivially solvable, and the typehint/verbosity
> issue as a non-issue).
>
> I've opened a discussion in the hhvm.dev group to look into this from
> that side, and removed my "No" vote for the time being. (I'm not sold
> on a "Yes" vote, however, as I'm not sure this buys us enough in its
> proposed form).
>
> -Sara
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
And how do you think the docblock issue could be trivially solvable?
Not from implementation POV,
but from syntactic POV?
Because I really don't want to write something like this:
/**
* @prop string $email @ORM\Column(type="string", unique=true)
@Assert\NotEmpty @Assert\Email
* @prop string $username @ORM\Column(type="string", unique=true)
@Assert\NotEmpty
*/
public function __construct(private $email, private $username) { }
Sure, it saves tons of lines of code from the classic docblock over
class field approach, but it is not as easily
readable. One docblock per line seems infinitely better to me.
Also I'm not sure if it's OK to "reveal" internal class implementation
via docblock and constructor parameters.