public function verifyTemplates($value, ExecutionContextInterface $context)
    {
        $data = $context->getRoot()->getData();

        if (!empty($data['templates']) && $data['method'] !== BaseHook::INJECT_TEMPLATE_METHOD_NAME) {
            $context->addViolation(
                $this->trans(
                    "If you use automatic insert templates, you should use the method %method%",
                    [
                        '%method%' => BaseHook::INJECT_TEMPLATE_METHOD_NAME
                    ]
                )
            );
        }
    }
public function verifyTemplates($value, ExecutionContextInterface $context)
    {
        $data = $context->getRoot()->getData();

        if (!empty($data['templates']) && $data['method'] !== BaseHook::INJECT_TEMPLATE_METHOD_NAME) {
            $context->addViolation(
                $this->trans(
                    "If you use automatic insert templates, you should use the method %method%",
                    [
                        '%method%' => BaseHook::INJECT_TEMPLATE_METHOD_NAME
                    ]
                )
            );
        }
    }
public function verifyTemplates ( $ value , ExecutionContextInterface $ context ) { $ data = $ context -> getRoot ( ) -> getData ( ) ; if ( ! empty ( $ data [ 'templates' ] ) && $ data [ 'method' ] !== BaseHook :: INJECT_TEMPLATE_METHOD_NAME ) { $ context -> addViolation ( $ this -> trans ( "If you use automatic insert templates, you should use the method %method%" , [ '%method%' => BaseHook :: INJECT_TEMPLATE_METHOD_NAME ] ) ) ; } }
Check if method is the right one if we want to use automatic inserted templates .

@param $value
@param  ExecutionContextInterface $context

@return bool
Check if method is the right one if we want to use automatic inserted templates .