lib/Core/Validator/LayoutResolverValidator.php
public function validateRuleCreateStruct(RuleCreateStruct $ruleCreateStruct): void
    {
        if ($ruleCreateStruct->layoutId !== null) {
            $this->validate(
                $ruleCreateStruct->layoutId,
                [
                    new Constraints\NotBlank(),
                    new Constraints\Type(['type' => 'scalar']),
                ],
                'layoutId'
            );
        }

        if ($ruleCreateStruct->priority !== null) {
            $this->validate(
                $ruleCreateStruct->priority,
                [
                    new Constraints\Type(['type' => 'int']),
                ],
                'priority'
            );
        }

        if ($ruleCreateStruct->enabled !== null) {
            $this->validate(
                $ruleCreateStruct->enabled,
                [
                    new Constraints\Type(['type' => 'bool']),
                ],
                'enabled'
            );
        }

        if ($ruleCreateStruct->comment !== null) {
            $this->validate(
                $ruleCreateStruct->comment,
                [
                    new Constraints\Type(['type' => 'string']),
                ],
                'comment'
            );
        }
    }
public function validateRuleCreateStruct(RuleCreateStruct $ruleCreateStruct): void
    {
        if ($ruleCreateStruct->layoutId !== null) {
            $this->validate(
                $ruleCreateStruct->layoutId,
                [
                    new Constraints\NotBlank(),
                    new Constraints\Type(['type' => 'scalar']),
                ],
                'layoutId'
            );
        }

        if ($ruleCreateStruct->priority !== null) {
            $this->validate(
                $ruleCreateStruct->priority,
                [
                    new Constraints\Type(['type' => 'int']),
                ],
                'priority'
            );
        }

        if ($ruleCreateStruct->enabled !== null) {
            $this->validate(
                $ruleCreateStruct->enabled,
                [
                    new Constraints\Type(['type' => 'bool']),
                ],
                'enabled'
            );
        }

        if ($ruleCreateStruct->comment !== null) {
            $this->validate(
                $ruleCreateStruct->comment,
                [
                    new Constraints\Type(['type' => 'string']),
                ],
                'comment'
            );
        }
    }
public function validateRuleCreateStruct ( RuleCreateStruct $ ruleCreateStruct ) : void { if ( $ ruleCreateStruct -> layoutId !== null ) { $ this -> validate ( $ ruleCreateStruct -> layoutId , [ new Constraints \ NotBlank ( ) , new Constraints \ Type ( [ 'type' => 'scalar' ] ) , ] , 'layoutId' ) ; } if ( $ ruleCreateStruct -> priority !== null ) { $ this -> validate ( $ ruleCreateStruct -> priority , [ new Constraints \ Type ( [ 'type' => 'int' ] ) , ] , 'priority' ) ; } if ( $ ruleCreateStruct -> enabled !== null ) { $ this -> validate ( $ ruleCreateStruct -> enabled , [ new Constraints \ Type ( [ 'type' => 'bool' ] ) , ] , 'enabled' ) ; } if ( $ ruleCreateStruct -> comment !== null ) { $ this -> validate ( $ ruleCreateStruct -> comment , [ new Constraints \ Type ( [ 'type' => 'string' ] ) , ] , 'comment' ) ; } }
Validates the provided rule create struct.

@throws \Netgen\BlockManager\Exception\Validation\ValidationException If the validation failed
Validates the provided rule create struct .