Skip to content

Navigation Menu

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

Appearance settings

Commit b5b27a8

Browse filesBrowse files
committed
bug #60288 [VarExporter] dump default value for property hooks if present (xabbuh)
This PR was merged into the 6.4 branch. Discussion ---------- [VarExporter] dump default value for property hooks if present | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT The test added in #60258 reveals that we have another bug in our lazy ghost generation logic which leads to an error at runtime when a hook tries to read the property's default value. Commits ------- e819dab dump default value for property hooks if present
2 parents b59a25a + e819dab commit b5b27a8
Copy full SHA for b5b27a8

File tree

1 file changed

+3
-1
lines changed
Filter options

1 file changed

+3
-1
lines changed

‎src/Symfony/Component/VarExporter/ProxyHelper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/VarExporter/ProxyHelper.php
+3-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ public static function generateLazyGhost(\ReflectionClass $class): string
7979
$hooks .= "\n "
8080
.($p->isProtected() ? 'protected' : 'public')
8181
.($p->isProtectedSet() ? ' protected(set)' : '')
82-
." {$type} \${$name} {\n";
82+
." {$type} \${$name}"
83+
.($p->hasDefaultValue() ? ' = '.$p->getDefaultValue() : '')
84+
." {\n";
8385

8486
foreach ($p->getHooks() as $hook => $method) {
8587
if ('get' === $hook) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.