Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Wrap variables in {} for safer interpolation#3555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
weaverryan merged 3 commits intosymfony:2.3fromifdattic:safer-variable-interpolation
Feb 16, 2014
Merged

Wrap variables in {} for safer interpolation#3555

weaverryan merged 3 commits intosymfony:2.3fromifdattic:safer-variable-interpolation
Feb 16, 2014

Conversation

ifdattic
Copy link
Contributor

QA
Doc fix?yes
New docs?no
Applies to2.3
Fixed tickets

@wouterj
Copy link
Member

-1, this will properbly confuse people. It's not a common known feature of PHP. I prefer to put the variables outside the quotes instead

@cordoval
Copy link
Contributor

does symfony avoid this syntax all the time on its source code? I never saw a discussion on this but interested in learning the reason.

@ifdattic
Copy link
ContributorAuthor

I personally like to wrap interpolated variables just to be on the safe side, but I agree that it might confuse people who are new to PHP as in most books/etc. I read/checked interpolation is actually quite a common reference.

As someone who just recently read all the book, cookbook and most of the components, as far as I can remember I think is the only page I saw interpolated variables in the documentation.

@wouterj
Copy link
Member

In the rest of the docs, we use"A string with a".$variable.", yeah!". Let's use it here too

@ifdattic
Copy link
ContributorAuthor

Yes, most of code examples use concatenation. This PR should be closed then.

@wouterj
Copy link
Member

well, if you can update this PR to change it to concatenation, it'll be better :) (otherwise, you can hit the close button yourself and create an issue, so someone else can do it)

@ifdattic
Copy link
ContributorAuthor

I also removed newline character on last echo statement as I could not thing of good reason why this one has a it and other foreach loops doesn't.

@xabbuh
Copy link
Member

I think the Symfony standard is to use single quotes instead of double quotes.

@weaverryan
Copy link
Member

Nice work guys 👍!

weaverryan added a commit that referenced this pull requestFeb 16, 2014
This PR was merged into the 2.3 branch.Discussion----------Wrap variables in {} for safer interpolation| Q             | A| ------------- | ---| Doc fix?      | yes| New docs?     | no| Applies to    | 2.3| Fixed tickets |Commits-------4046476 Replace double quotes with single quotes0f7a189 Change interpolation to concatenationd3839ce Wrap variables in {} for safer interpolation
@weaverryanweaverryan merged commit4046476 intosymfony:2.3Feb 16, 2014
@ifdatticifdattic deleted the safer-variable-interpolation branchFebruary 16, 2014 20:00
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@ifdattic@wouterj@cordoval@xabbuh@weaverryan

[8]ページ先頭

©2009-2025 Movatter.jp