8000 [VarDumper] Add a caster for the FlattenException by lyrixx · Pull Request #49853 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[VarDumper] Add a caster for the FlattenException #49853

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

lyrixx
Copy link
Member
@lyrixx lyrixx commented Mar 28, 2023
Q A
Branch? 6.3
Bug fix? no
New feature? yes
Deprecations? no
Tickets
License MIT
Doc PR

The information is duplicated, and when debuging messenger errors, the output is way too verbose.
This PR enchance the situation.

public static function castFlattenException(FlattenException $e, array $a, Stub $stub, bool $isNested)
{
if ($isNested) {
$k = sprintf(Caster::PATTERN_PRIVATE, FlattenException::class, 'traceAsString');
Copy link
Member

Choose a reason for hiding this comment

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

updated to benefit from #49852 ;)

@@ -354,4 +355,33 @@ public function testAnonymous()

$this->assertDumpMatchesFormat($expectedDump, $e, Caster::EXCLUDE_VERBOSE);
}

/**
* @requires function \Symfony\Component\ErrorHandler\Exception\FlattenException::create
8000
Copy link
Member

Choose a reason for hiding this comment

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

@requires FTW

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh! Nice. I check for requires class but it didn't exist. Nice usage of "function"

@nicolas-grekas
Copy link
Member

Thank you @lyrixx.

@nicolas-grekas nicolas-grekas merged commit cb22f8c into symfony:6.3 Mar 30, 2023
@lyrixx lyrixx deleted the var-dump-flatten branch March 30, 2023 07:49
chalasr added a commit that referenced this pull request Apr 5, 2023
This PR was merged into the 6.3 branch.

Discussion
----------

Fix the test for casting FlattenException on Windows

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

The assertion should avoid forcing to show path separators, as done in other tests of the caster, as path separators are different on Windows.
This fixes the test introduced in #49853

Commits
-------

1464e1e Fix the test for casting FlattenException on Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0