Skip to content

[Config] Improve casting config nodes to array #51273

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

Open
wants to merge 1 commit into
base: 7.4
Choose a base branch
from

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Aug 4, 2023

Q A
Branch? 6.4
Bug fix? no
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

Interestingly, this makes tests fail in Config, see note in the patch.
Help wanted to understand what's going on and how to fix this.

@maxbeckers
Copy link
Contributor

@nicolas-grekas the scheduler test is already fixed with #51271 / #51274 and not related to your change!

@@ -77,7 +77,7 @@ public function ifTrue(\Closure $closure = null): static
public function ifString(): static
{
$this->ifPart = \is_string(...);
$this->allowedTypes = self::TYPE_STRING;
$this->allowedTypes = self::TYPE_STRING; // XXX why is this used by ConfigBuilderGenerator instead of the prototype?
Copy link
Contributor

Choose a reason for hiding this comment

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

By default it's type TYPE_ANY what results in mixed. For me it seems that this is a workaround to interpret this as a string after the check.

@nicolas-grekas nicolas-grekas modified the milestones: 6.4, 7.1 Nov 15, 2023
@xabbuh xabbuh modified the milestones: 7.1, 7.2 May 15, 2024
@fabpot fabpot modified the milestones: 7.2, 7.3 Nov 20, 2024
@fabpot fabpot modified the milestones: 7.3, 7.4 May 26, 2025
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.

5 participants