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

[VarDumper] Fixed dumping of terminated generator#21542

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
nicolas-grekas merged 1 commit intosymfony:2.8fromlyrixx:dump-generator
Feb 6, 2017

Conversation

@lyrixx
Copy link
Member

QA
Branch?2.8
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

try {
$reflectionGenerator =new \ReflectionGenerator($c);
}catch (\Exception$e) {
return$a;

Choose a reason for hiding this comment

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

let's add a virtual prop that says closed: true?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Good idea. Added.

$a[$prefix.'this'] =newCutStub($c->getThis());
}
$x =$c->getFunction();
$function =$c->getFunction();

Choose a reason for hiding this comment

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

diff irrelevant for review

{
returnclass_exists('ReflectionGenerator',false) ?self::castReflectionGenerator(new \ReflectionGenerator($c),$a,$stub,$isNested) :$a;
if (!class_exists('ReflectionGenerator',false)) {
return$a;

Choose a reason for hiding this comment

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

closed: true/false virtual prop?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

How can I know?

Choose a reason for hiding this comment

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

call->valid()?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I can not because it alters the generator. That's why I used the try catch method and not->valid().

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

👍

// Cannot create ReflectionGenerator based on a terminated Generator
try {
$reflectionGenerator =new \ReflectionGenerator($c);
}catch (\Exception$e) {

Choose a reason for hiding this comment

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

I confirm that anException is thrown here, even-though I'd personally have expected aReflectionException
ping@jpauli.

Choose a reason for hiding this comment

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

This has been fixed as part of PHP 7.2 inphp/php-src@ed4216c

@nicolas-grekas
Copy link
Member

Thank you@lyrixx.

@nicolas-grekasnicolas-grekas merged commitc5094a0 intosymfony:2.8Feb 6, 2017
nicolas-grekas added a commit that referenced this pull requestFeb 6, 2017
This PR was merged into the 2.8 branch.Discussion----------[VarDumper] Fixed dumping of terminated generator| Q             | A| ------------- | ---| Branch?       | 2.8| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -Commits-------c5094a0 [VarDumper] Fixed dumping of terminated generator
@lyrixxlyrixx deleted the dump-generator branchFebruary 6, 2017 16:53
@fabpotfabpot mentioned this pull requestFeb 17, 2017
@fabpotfabpot mentioned this pull requestMar 6, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+1 more reviewer

@jpaulijpaulijpauli left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@lyrixx@nicolas-grekas@jpauli@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp