ekino /
drupal-debug
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | /* |
||
| 6 | * This file is part of the ekino Drupal Debug project. |
||
| 7 | * |
||
| 8 | * (c) ekino |
||
| 9 | * |
||
| 10 | * For the full copyright and license information, please view the LICENSE |
||
| 11 | * file that was distributed with this source code. |
||
| 12 | */ |
||
| 13 | |||
| 14 | namespace Ekino\Drupal\Debug\Configuration; |
||
| 15 | |||
| 16 | use Ekino\Drupal\Debug\Configuration\Model\ActionConfiguration; |
||
| 17 | use Ekino\Drupal\Debug\Configuration\Model\DefaultsConfiguration as DefaultsConfigurationModel; |
||
| 18 | use Symfony\Component\Config\Definition\Builder\NodeBuilder; |
||
| 19 | |||
| 20 | trait CharsetConfigurationTrait |
||
| 21 | { |
||
| 22 | 19 | private static function addCharsetConfigurationNode(NodeBuilder $nodeBuilder, ?string $defaultCharset): NodeBuilder |
|
| 23 | { |
||
| 24 | return $nodeBuilder |
||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 25 | 19 | ->scalarNode('charset') |
|
| 26 | 19 | ->defaultValue($defaultCharset) |
|
| 27 | 19 | ->end(); |
|
| 28 | } |
||
| 29 | |||
| 30 | 19 | private static function addCharsetConfigurationNodeFromDefaultsConfiguration(NodeBuilder $nodeBuilder, DefaultsConfigurationModel $defaultsConfiguration): NodeBuilder |
|
| 31 | { |
||
| 32 | 19 | return self::addCharsetConfigurationNode($nodeBuilder, $defaultsConfiguration->getCharset()); |
|
| 33 | } |
||
| 34 | |||
| 35 | 2 | private static function getConfiguredCharset(ActionConfiguration $actionConfiguration): ?string |
|
| 36 | { |
||
| 37 | 2 | $processedConfiguration = $actionConfiguration->getProcessedConfiguration(); |
|
| 38 | |||
| 39 | 2 | return $processedConfiguration['charset']; |
|
| 40 | } |
||
| 41 | } |
||
| 42 |