dumpAtPath example

$dumper = new YamlReferenceDumper();
                break;
            case 'xml':
                $io->writeln(sprintf('<!-- %s -->', $message));
                $dumper = new XmlReferenceDumper();
                break;
            default:
                $io->writeln($message);
                throw new InvalidArgumentException(sprintf('Supported formats are "%s".', implode('", "', $this->getAvailableFormatOptions())));
        }

        $io->writeln(null === $path ? $dumper->dump($configuration$extension->getNamespace()) : $dumper->dumpAtPath($configuration$path));

        return 0;
    }

    public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void
    {
        if ($input->mustSuggestArgumentValuesFor('name')) {
            $suggestions->suggestValues($this->getAvailableExtensions());
            $suggestions->suggestValues($this->getAvailableBundles());
        }

        


    /** * @dataProvider provideDumpAtPath */
    public function testDumpAtPath(string $path, string $expected)
    {
        $configuration = new ExampleConfiguration();

        $dumper = new YamlReferenceDumper();

        $this->assertSame(trim($expected)trim($dumper->dumpAtPath($configuration$path)));
    }

    private function getConfigurationAsString(): string
    {
        return <<<'EOL' acme_root: boolean: true scalar_empty: ~ scalar_null: null scalar_true: true scalar_false: false scalar_default: default scalar_array_empty: [] scalar_array_defaults: # Defaults: - elem1 - elem2 scalar_required: ~ # Required scalar_deprecated: ~ # Deprecated (Since vendor/package 1.1: The child node "scalar_deprecated" at path "acme_root" is deprecated.) scalar_deprecated_with_message: ~ # Deprecated (Since vendor/package 1.1: Deprecation custom message for "scalar_deprecated_with_message" at "acme_root") node_with_a_looong_name: ~ enum_with_default: this # One of "this"; "that" enum: ~ # One of "this"; "that"; Symfony\Component\Config\Tests\Fixtures\TestEnum::Ccc # some info array: child1: ~ child2: ~ # this is a long # multi-line info text # which should be indented child3: ~ # Example: 'example setting' scalar_prototyped: [] variable: # Examples: - foo - bar parameters: # Prototype: Parameter name name: ~ connections: # Prototype - user: ~ pass: ~ cms_pages: # Prototype page: # Prototype locale: title: ~ # Required path: ~ # Required pipou: # Prototype name: [] custom_node: true
Home | Imprint | This part of the site doesn't use cookies.