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

Encourage use of constants#10308

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

Closed
trsteel88 wants to merge2 commits intosymfony:4.1fromtrsteel88:patch-1
Closed

Conversation

@trsteel88
Copy link
Contributor

Function should be static and we should also encourage the use of constants

Function should be static and we should also encourage the use of constants
@trsteel88
Copy link
ContributorAuthor

Sorry, it shouldn't be static as that method comes from Doctrine and differs to Symfony's event subscriber. Updated that and just kept the constants.

@trsteel88trsteel88 changed the titleMethod should be static. Encourage use of constEncourage use of constantsSep 10, 2018
@javiereguiluz
Copy link
Member

@trsteel88 thanks for this contribution! However, I think the new code is different than the existing code. Is this a bug fix, an improvement or both? We'll need help from Doctrine experts to verify this proposal. Thanks!

Copy link
Contributor

@ndenchndench left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@javiereguiluz this doesn't change the existing code. You can see from thedoctrine source that event constants are the same as the original strings.

Also thedoctrine documentation recommends using the event constants:

<?phpuse Doctrine\ORM\Events;echo Events::preUpdate;

'postPersist',
'postUpdate',
\Doctrine\ORM\Events::postPersist =>'postPersist',
\Doctrine\ORM\Events::postUpdate =>'postUpdate',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think we should importDoctrine\ORM\Events and useEvents::postPersist andEvents::postUpdate here instead.

xabbuh and HeahDude reacted with thumbs up emoji
@xabbuhxabbuh added this to the2.8 milestoneNov 15, 2018
xabbuh added a commit that referenced this pull requestNov 15, 2018
This PR was submitted for the 4.1 branch but it was squashed and merged into the 2.8 branch instead (closes#10308).Discussion----------Encourage use of constantsFunction should be static and we should also encourage the use of constantsCommits-------10422dc Encourage use of constants
xabbuh added a commit that referenced this pull requestNov 15, 2018
@xabbuh
Copy link
Member

Thank you for this change@trsteel88. I have merged your changes into the2.8 branch (from where it will be merged up to all maintained branches) and made some small tweaks in88939de.

@xabbuhxabbuh closed thisNov 15, 2018
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull requestNov 15, 2018
* 2.8:  [symfony#10308] add use statement and fix array  Encourage use of constants  delete var_dump() functions in examples
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull requestNov 15, 2018
* 3.4:  [symfony#10308] add use statement and fix array  Encourage use of constants  Update code-splitting.rst  delete var_dump() functions in examples  Update image to reflect given state machine example configuration
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull requestNov 15, 2018
* 4.1:  [symfony#10308] add use statement and fix array  Encourage use of constants  Update code-splitting.rst  delete var_dump() functions in examples  Update image to reflect given state machine example configuration
@trsteel88trsteel88 deleted the patch-1 branchNovember 15, 2018 23:16
@trsteel88
Copy link
ContributorAuthor

No worries. Sorry I fell off the face of the earth. Been a bit hectic.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@wouterjwouterjAwaiting requested review from wouterj

1 more reviewer

@ndenchndenchndench requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

2.8

Development

Successfully merging this pull request may close these issues.

5 participants

@trsteel88@javiereguiluz@xabbuh@ndench@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp