buildViolationSectionSeparator example

#[Assert\Callback]     public function validate(ExecutionContextInterface $context): void
    {
        if (empty($this->api) && empty($this->core) && empty($this->storefront) && empty($this->administration)) {
            $context->buildViolation('You have to define at least one change of API, Core, Administration or Storefront')
                ->addViolation();
        }

        if ($this->api) {
            if (preg_match('/\n+#\s+(\w+)/', $this->api, $matches)) {
                $this->buildViolationSectionSeparator($context, ChangelogSection::api, $matches[1]);
            }
            $this->checkChangelogEntries($context$this->api, ChangelogSection::api);
        }

        if ($this->storefront) {
            if (preg_match('/\n+#\s+(\w+)/', $this->storefront, $matches)) {
                $this->buildViolationSectionSeparator($context, ChangelogSection::storefront, $matches[1]);
            }
            $this->checkChangelogEntries($context$this->storefront, ChangelogSection::storefront);
        }

        
Home | Imprint | This part of the site doesn't use cookies.