Skip to content
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

Allow classname in 'value' attribute of xml discriminator-mapping field #11453

Conversation

MatteoFeltrin
Copy link
Contributor

@MatteoFeltrin MatteoFeltrin commented May 14, 2024

fixes #11449

In relation to #10630
This PR allows a more loosen validation of the value attribute of discriminator-mapping field, using orm:type in the XSD schema as it was done in the linked pull request.
The test I wrote loads the entity enabling the validation against XSD schema, thus expects no exception to be thrown.


class CustomerType
{
public $name;
Copy link
Member

Choose a reason for hiding this comment

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

Let's declare string here, or directly use constructor property promotion

Copy link
Contributor Author

@MatteoFeltrin MatteoFeltrin May 15, 2024

Choose a reason for hiding this comment

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

PHPStorm gives these errors:

Typed properties are only allowed since PHP 7.4

Constructor property promotion is only allowed since PHP 8.0

Composer.json

"require": {
        "php": "^7.1 || ^8.0",
        ...,
}

@MatteoFeltrin MatteoFeltrin force-pushed the allow-fqcn-in-value-attribute-of-discriminator-mapping branch from 9e2c8cf to 73e30df Compare May 20, 2024 09:01
Copy link
Contributor

There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.
If you want to continue working on it, please leave a comment.

@github-actions github-actions bot added the Stale label Oct 15, 2024
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

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

IMO to be merged in

@greg0ire greg0ire added the Bug label Oct 15, 2024
@greg0ire greg0ire changed the base branch from 2.19.x to 2.20.x October 15, 2024 06:55
@greg0ire greg0ire added this to the 2.20.1 milestone Oct 16, 2024
@greg0ire greg0ire merged commit 9e884cc into doctrine:2.20.x Oct 16, 2024
@greg0ire
Copy link
Member

Thanks @MatteoFeltrin !

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.

4 participants