public function getConfiguration(string
$domain, Context
$context): array
{ $validDomain =
preg_match('/^([\w-]+)\.?([\w-]*)$/',
$domain,
$match);
if (!
$validDomain) { throw new \
InvalidArgumentException('Expected domain'
);
} $scope =
$match[1
];
$configName =
$match[2
] !== '' ?
$match[2
] : null;
$config =
$this->
fetchConfiguration($scope === 'core' ? 'System' :
$scope,
$configName,
$context);
if (!
$config) { throw new ConfigurationNotFoundException($scope);
} $domain =
rtrim($domain, '.'
) . '.';
foreach ($config as $i =>
$card) { if (\
array_key_exists('flag',
$card) && !Feature::
isActive($card['flag'
])) { unset($config[$i]);
continue;
}