getFileName(), 5); $config = require $vendorDirectory . '/drupol/php-conventions/config/php73/php_cs_fixer.config.php'; $config ->getFinder() ->ignoreDotFiles(false); $rules = $config->getRules(); $riskyRules = array_reduce( array_filter( RuleSets::getSetDefinitions(), static function (RuleSetDescriptionInterface $ruleset): bool { return $ruleset->isRisky(); } ), static function (array $carry, RuleSetDescriptionInterface $ruleSetDescription): array { return array_merge($carry, array_keys($ruleSetDescription->getRules())); }, [] ); $rules['header_comment']['header'] = trim(file_get_contents(__DIR__ . '/resource/header.txt')); // Remove properties containing the word 'risky'. // Remove custom risky properties $rules = array_filter( array_filter( array_diff_key( $rules, array_flip($riskyRules) ), static function (string $property): bool { return false === strpos(strtolower($property), 'risky'); }, ARRAY_FILTER_USE_KEY ), static function (string $property): bool { return false === in_array( $property, [ 'static_lambda', 'ordered_interfaces', 'psr4', ] ); }, ARRAY_FILTER_USE_KEY ); return $config->setRules($rules);