private function getIgnoreFilters(Composer $composer): array
    {
        $extra = $composer->getPackage()->getExtra();

        return array_map(
            function (string $rule) : ViolationFilterInterface {
                $filters = [
                    new ExactPackageFilter($rule),
                    new PatternPackageFilter($rule)
                ];

                if (preg_match('#/$#', $rule)) {
                    $filters[] = new VendorFilter($rule);
                }

                return new ViolationFilterChain(...$filters);
            },
            $extra['dependency-guard']['ignore'] ?? []
        );
    }