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

Can't dump rules under Nested rule #592

Open
BoShurik opened this issue Mar 3, 2023 · 0 comments
Open

Can't dump rules under Nested rule #592

BoShurik opened this issue Mar 3, 2023 · 0 comments
Labels
status:ready for adoption Feel free to implement this issue. type:bug Bug
Milestone

Comments

@BoShurik
Copy link

BoShurik commented Mar 3, 2023

class Profile
{
    #[Nested]
    public ?Requisites $requisites = null;
}

class Requisites
{
    #[Required]
    public string $bik;

    #[Required]
    public string $rs;
}

RulesDumper::asArray((new ObjectDataSet(new Profile()))->getRules());

Result will be:

'requisites' => [
    0 => [
        0 => 'nested'
        'noRulesWithNoObjectMessage' => [
'template' => 'Nested rule without rules can be used for objects only.'
            'parameters' => []
        ]
        'incorrectDataSetTypeMessage' => [
'template' => 'An object data set data can only have an array type.'
            'parameters' => []
        ]
        'incorrectInputMessage' => [
'template' => 'The value must be an array or an object.'
            'parameters' => []
        ]
        'noPropertyPathMessage' => [
'template' => 'Property "{path}" is not found.'
            'parameters' => []
        ]
        'requirePropertyPath' => false
        'skipOnEmpty' => false
        'skipOnError' => false
        'rules' => null
    ]
]
@samdark samdark added type:bug Bug status:ready for adoption Feel free to implement this issue. labels Mar 5, 2023
@samdark samdark added this to the 2.0 milestone May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready for adoption Feel free to implement this issue. type:bug Bug
Projects
None yet
Development

No branches or pull requests

2 participants