Netbeans also "warns" about this kind of assignment, alerting the
developer that it may be an accidental assignment (since it could have
been intended as == or ===).

I just turned off that particular warning...

It's an interesting point, but it's not really a failing in coding
standards, more coding opinion. I don't see any major reason to try
and refactor the existing symfony projects to satisfy this, but it may
be something Fabien will consider for Symfony 2 I guess.

On Dec 15, 8:40 pm, Davide Borsatto <[email protected]> wrote:
> With "assignment in condition" you mean something like
>
> if ($results = $this->getResults())
> {
>   // ...
>
> }
>
> ?
>
> If so, then I think it's not about coding standards. Those standards
> define the way you indent code, where you put brackets and stuff like
> this.
> By the way the refactored code above would be look like this:
>
> $results = $this->getResults();
> if ($results)
> {
>   // ...
>
> }
>
> Which brings honestly only un-necessary verbosity to the code, without
> actually improving quality. Plus as you say, that is a perfectly legal
> statement, and I don't know where it could lead to problems compared
> to getting the assignment out of the condition. I know this is a
> simple example, but the concept of the problem is that it's your
> editor's problem :)
>
> Of course, IMHO.
>
> On Dec 15, 5:46 pm, Alexandru-Emil Lupu <[email protected]> wrote:
>
>
>
> > HI!
> > I would like to ask you /  tell you about a coding standard present in
> > the symfony.
> > I am using Zend Studio 7 and my "error" tab shows me a lot of symfony
> > problems that i guess it is not ok to be there.
> > The most present error met is the "Assignment in condition", which, i
> > think is really a problem, because will not let the devs solve or will
> > hide their project problems.
> > I know that this kind of statement is perfectly legal, but it might
> > hide some problems generated by the devs... Unfortunately not all the
> > devs are using TDD or have their code "test covered"
>
> > Let me know what opinion do you have about this request / enhancement .
>
> > Alecs
>
> > --
> > Have a nice day!
> > Alecs
>
> > As programmers create bigger & better idiot proof programs, so the
> > universe creates bigger & better idiots!
> > I am on web:  http://www.alecslupu.ro/
> > I am on twitter:http://twitter.com/alecslupu
> > I am on linkedIn:http://www.linkedin.com/in/alecslupu
> > Tel: (+4)0748.543.798- Hide quoted text -
>
> - Show quoted text -

--

You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en.


Reply via email to