RuleDefinition example

if ($this->hasPackageAnnotation($node)) {
            return null;
        }

        $node->attrGroups[] = $this->phpAttributeGroupFactory->createFromClassWithItems(Package::class[$area]);

        return $node;
    }

    public function getRuleDefinition(): RuleDefinition
    {
        return new RuleDefinition(
            'Adds a #[Package] attribute to all php classes corresponding to the area mapping.',
            [
                new CodeSample(
                    // code before                     ' class Foo{}',

                    // code after                     ' #[Package(\'core\')] class Foo{}'
                ),
Home | Imprint | This part of the site doesn't use cookies.