Skip to content

Conversation

@nicolas-grekas
Copy link
Member

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Part of #41552
License MIT
Doc PR -

@carsonbot
Copy link

Hey!

I think @fancyweb has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

$signature .= 10 > \strlen($v) && !str_contains($v, '\\') ? "'{$v}'" : "'…".\strlen($v)."'";
} elseif (\is_bool($v)) {
$signature .= $v ? 'true' : 'false';
} elseif (\is_object($v)) {
Copy link
Member

Choose a reason for hiding this comment

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

What if the object is an Enum instance ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I just gave it a try: an Enum is seen as a const, aka $param->isDefaultValueConstant() returns true

@derrabus derrabus mentioned this pull request Oct 2, 2021
@nicolas-grekas nicolas-grekas merged commit 57f5df5 into symfony:4.4 Oct 5, 2021
@nicolas-grekas nicolas-grekas deleted the newinit branch October 6, 2021 11:59
This was referenced Oct 29, 2021
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