-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
src/contracts/DependencyInjection/Configuration/SiteAccessAware/IgnoredConfigParser.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\Contracts\Test\Core\DependencyInjection\Configuration\SiteAccessAware; | ||
|
||
use Ibexa\Bundle\Core\DependencyInjection\Configuration\AbstractParser; | ||
use Ibexa\Bundle\Core\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface; | ||
use Symfony\Component\Config\Definition\Builder\NodeBuilder; | ||
|
||
/** | ||
* SA configuration parser which allows ignoring given keys in tests. | ||
*/ | ||
final class IgnoredConfigParser extends AbstractParser | ||
{ | ||
/** @var string[] */ | ||
private array $keys; | ||
|
||
public function __construct(string ...$keys) | ||
{ | ||
$this->keys = $keys; | ||
} | ||
|
||
public function addSemanticConfig(NodeBuilder $nodeBuilder): void | ||
{ | ||
foreach ($this->keys as $key) { | ||
$nodeBuilder->variableNode($key)->defaultNull()->end(); | ||
} | ||
} | ||
|
||
/** | ||
* @param array<string,mixed> $scopeSettings | ||
*/ | ||
public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerInterface $contextualizer): void | ||
{ | ||
} | ||
} |