From 8ed99c00abcbd7874242dc87e39357943971eb2e Mon Sep 17 00:00:00 2001 From: Martin Georgiev Date: Sat, 30 May 2020 14:10:35 +0100 Subject: [PATCH 1/2] Update CI tools and steps --- .php_cs | 110 ------------------ .travis.yml | 16 +-- ci/deptrac/config.yml | 18 +++ ci/php-cs-fixer/config.php | 52 +++++++++ phpstan.neon => ci/phpstan/config.neon | 7 +- phpunit.xml => ci/phpunit/config.xml | 6 +- composer.json | 36 +++--- .../Compiler/AllInOnePass.php | 8 +- .../DependencyInjection/Configuration.php | 6 +- .../SocialPostExtension.php | 10 +- .../SocialPostBundle/SocialPostBundle.php | 4 +- .../SocialPostExtensionTest.php | 32 ++--- .../SocialPostBundle/SocialPostBundleTest.php | 6 +- 13 files changed, 134 insertions(+), 177 deletions(-) delete mode 100644 .php_cs create mode 100644 ci/deptrac/config.yml create mode 100644 ci/php-cs-fixer/config.php rename phpstan.neon => ci/phpstan/config.neon (68%) rename phpunit.xml => ci/phpunit/config.xml (74%) rename tests/MartinGeorgiev/SocialPostBundle/{DependecyInjection => DependencyInjection}/SocialPostExtensionTest.php (94%) diff --git a/.php_cs b/.php_cs deleted file mode 100644 index dd71678..0000000 --- a/.php_cs +++ /dev/null @@ -1,110 +0,0 @@ -in(__DIR__.'/src') - ->in(__DIR__.'/tests'); - -return PhpCsFixer\Config::create() - ->setRules( - [ - '@PSR2' => true, - '@PHP56Migration' => true, - '@PHP70Migration' => true, - '@PHP71Migration' => true, - '@DoctrineAnnotation' => true, - 'array_syntax' => ['syntax' => 'short'], - 'binary_operator_spaces' => true, - 'blank_line_after_opening_tag' => true, - 'blank_line_before_return' => true, - 'blank_line_before_statement' => true, - 'cast_spaces' => ['space' => 'single'], - 'combine_consecutive_issets' => true, - 'combine_consecutive_unsets' => true, - 'concat_space' => ['spacing' => 'none'], - 'declare_equal_normalize' => ['space' => 'none'], - 'dir_constant' => true, - 'ereg_to_preg' => true, - 'final_internal_class' => true, - 'function_to_constant' => true, - 'function_typehint_space' => true, - 'include' => true, - 'is_null' => true, - 'linebreak_after_opening_tag' => true, - 'list_syntax' => ['syntax' => 'short'], - 'lowercase_cast' => true, - 'magic_constant_casing' => true, - 'mb_str_functions' => true, - 'method_chaining_indentation' => true, - 'method_separation' => true, - 'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'], - 'modernize_types_casting' => true, - 'native_function_casing' => true, - 'new_with_braces' => true, - 'no_alias_functions' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_leading_import_slash' => true, - 'no_mixed_echo_print' => ['use' => 'echo'], - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_multiline_whitespace_before_semicolons' => true, - 'no_null_property_initialization' => true, - 'no_short_bool_cast' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_after_function_name' => true, - 'no_spaces_around_offset' => true, - 'no_spaces_inside_parenthesis' => true, - 'no_superfluous_elseif' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unneeded_curly_braces' => true, - 'no_unneeded_final_method' => true, - 'no_unreachable_default_argument_value' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'non_printable_character' => false, - 'object_operator_without_whitespace' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_empty_return' => true, - 'phpdoc_no_package' => true, - 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_return_self_reference' => true, - 'phpdoc_scalar' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_to_comment' => true, - 'phpdoc_types' => true, - 'phpdoc_var_without_name' => true, - 'increment_style' => ['style' => 'post'], - 'return_type_declaration' => true, - 'self_accessor' => true, - 'semicolon_after_instruction' => true, - 'short_scalar_cast' => true, - 'silenced_deprecation_error' => true, - 'single_blank_line_before_namespace' => true, - 'single_line_comment_style' => false, - 'single_quote' => true, - 'space_after_semicolon' => true, - 'standardize_not_equals' => true, - 'static_lambda' => true, - 'strict_comparison' => true, - 'strict_param' => true, - 'ternary_operator_spaces' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'void_return' => false, // @todo enable once package moved to PHP 7.1 - 'whitespace_after_comma_in_array' => true, - ] - ) - ->setRiskyAllowed(true) - ->setUsingCache(false) - ->setIndent(" ") - ->setLineEnding("\n") - ->setFinder($finder); diff --git a/.travis.yml b/.travis.yml index 3ae33f3..648c10b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,19 +7,18 @@ cache: - $HOME/.composer/cache php: - - 7.1 - 7.2 - 7.3 + - 7.4 - nightly env: global: - - LATEST_PHP_VERSION="7.3" + - LATEST_PHP_VERSION="7.4" matrix: - - SYMFONY_VERSION="2.8.*" - SYMFONY_VERSION="3.4.*" - - SYMFONY_VERSION="4.1.*" - - SYMFONY_VERSION="4.2.*" + - SYMFONY_VERSION="4.3.*" + - SYMFONY_VERSION="4.4.*" - SYMFONY_VERSION="dev-master" - DEPENDENCIES="beta" - DEPENDENCIES="low" @@ -57,15 +56,10 @@ install: fi; script: - - if [ "$(phpenv version-name)" != "$LATEST_PHP_VERSION" ]; then - echo "File validation is skipped for older PHP versions"; - else - composer validate-files; - fi; - if [ "$(phpenv version-name)" != "$LATEST_PHP_VERSION" ]; then echo "Static analysis is skipped for older PHP versions"; else - composer run-static-analysis-including-tests; + composer run-static-analysis; fi; - if [ "$(phpenv version-name)" != "$LATEST_PHP_VERSION" ]; then echo "Code style check is skipped for older PHP versions"; diff --git a/ci/deptrac/config.yml b/ci/deptrac/config.yml new file mode 100644 index 0000000..ce2d726 --- /dev/null +++ b/ci/deptrac/config.yml @@ -0,0 +1,18 @@ +paths: + - ./src + - ./tests + +layers: + - name: Bundle + collectors: + - type: className + regex: \\MartinGeorgiev\\SocialPostBundle\\.* + - name: Tests + collectors: + - type: className + regex: \\Tests\\MartinGeorgiev\\SocialPostBundle\\.* + +ruleset: + Bundle: ~ + Tests: + - Bundle diff --git a/ci/php-cs-fixer/config.php b/ci/php-cs-fixer/config.php new file mode 100644 index 0000000..b4a96a5 --- /dev/null +++ b/ci/php-cs-fixer/config.php @@ -0,0 +1,52 @@ +in($rootDirectory.'/src') + ->in($rootDirectory.'/tests'); + +return PhpCsFixer\Config::create() + ->setRules( + [ + '@PSR2' => true, + '@PHP56Migration' => true, + '@PHP70Migration' => true, + '@PHP71Migration' => true, + '@DoctrineAnnotation' => true, + '@PhpCsFixer' => true, + 'align_multiline_comment' => false, + 'array_syntax' => ['syntax' => 'short'], + 'backtick_to_shell_exec' => true, + 'blank_line_before_statement' => ['statements' => ['break', 'declare', 'continue', 'declare', 'die', 'do', 'exit', 'return', 'throw', 'try', 'while']], + 'cast_spaces' => ['space' => 'single'], + 'concat_space' => ['spacing' => 'none'], + 'date_time_immutable' => true, + 'declare_equal_normalize' => ['space' => 'none'], + 'increment_style' => ['style' => 'post'], + 'linebreak_after_opening_tag' => true, + 'list_syntax' => ['syntax' => 'short'], + 'mb_str_functions' => false, + 'method_chaining_indentation' => true, + 'multiline_whitespace_before_semicolons' => false, + 'native_function_invocation' => ['include' => ['@all']], + 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true], + 'non_printable_character' => false, + 'ordered_class_elements' => ['order' => ['use_trait', 'constant', 'property', 'construct', 'magic', 'method']], + 'php_unit_internal_class' => false, + 'php_unit_method_casing' => ['case' => 'snake_case'], + 'php_unit_test_class_requires_covers' => false, + 'phpdoc_types_order' => ['null_adjustment' => 'always_last'], + 'simplified_null_return' => false, + 'single_line_comment_style' => false, + 'static_lambda' => true, + 'yoda_style' => false, + ] + ) + ->setRiskyAllowed(true) + ->setUsingCache(false) + ->setIndent(" ") + ->setLineEnding("\n") + ->setFinder($finder); diff --git a/phpstan.neon b/ci/phpstan/config.neon similarity index 68% rename from phpstan.neon rename to ci/phpstan/config.neon index b3bb9bc..b9aeece 100644 --- a/phpstan.neon +++ b/ci/phpstan/config.neon @@ -1,11 +1,8 @@ includes: - - vendor/phpstan/phpstan-phpunit/extension.neon + - ../../vendor/phpstan/phpstan-phpunit/extension.neon parameters: - autoload_directories: - - %rootDir%/../../../src - - %rootDir%/../../../tests - + checkMissingIterableValueType: false reportUnmatchedIgnoredErrors: false ignoreErrors: - '#Cannot call method scalarNode() on Symfony\\Component\\Config\\Definition\\Builder\\NodeParentInterface|null#' diff --git a/phpunit.xml b/ci/phpunit/config.xml similarity index 74% rename from phpunit.xml rename to ci/phpunit/config.xml index 1612d64..1ef2e68 100644 --- a/phpunit.xml +++ b/ci/phpunit/config.xml @@ -5,18 +5,18 @@ convertNoticesToExceptions="false" convertWarningsToExceptions="true" stopOnFailure="false" - bootstrap="vendor/autoload.php" + bootstrap="../../vendor/autoload.php" verbose="true"> - ./tests + ../../tests - ./src + ../../src diff --git a/composer.json b/composer.json index 08d53e9..66e753f 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "martin-georgiev/social-post-bundle", "type": "symfony-bundle", "description": "Symfony bundle for simultaneous posting of the same message to Facebook, LinkedIn and Twitter", - "keywords": ["martin georgiev", "symfony3", "symfony4", "bundle", "facebook", "twitter", "linkedin", "twitteroauth", "facabook sdk for php", "post update", "social network", "php7"], + "keywords": ["martin georgiev", "symfony", "bundle", "facebook", "twitter", "linkedin", "twitteroauth", "facabook sdk for php", "post update", "social network", "php7"], "minimum-stability": "stable", "license": "MIT", @@ -25,47 +25,41 @@ }, "require": { - "php": "^7.1", + "php": "^7.2", "martin-georgiev/social-post": "^1.0", "symfony/framework-bundle": "^3.0|^4.1.12", "symfony/yaml": "^3.0|^4.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.14", - "jakub-onderka/php-parallel-lint": "^1.0", - "php-coveralls/php-coveralls": "^2.1", - "phpstan/phpstan": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpunit/phpunit": "^7.5|^8.1", + "friendsofphp/php-cs-fixer": "^2.16", + "php-coveralls/php-coveralls": "^2.2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^8.5", + "sensiolabs-de/deptrac-shim": "^0.7.1", "sensiolabs/security-checker": "^6.0", "symfony/phpunit-bridge": "^3.0|^4.0" }, "scripts": { "check-code-style": [ - "php-cs-fixer fix --config='./.php_cs' --show-progress=none --dry-run --no-interaction --diff -v" + "bin/php-cs-fixer fix --config='./ci/php-cs-fixer/config.php' --show-progress=none --dry-run --no-interaction --diff -v" ], "check-security": [ - "security-checker security:check" + "bin/security-checker security:check" ], "fix-code-style": [ - "php-cs-fixer fix --config='./.php_cs' --show-progress=none --no-interaction --diff -v" + "bin/php-cs-fixer fix --config='./ci/php-cs-fixer/config.php' --show-progress=none --no-interaction --diff -v" ], "run-static-analysis": [ - "phpstan analyse --level=7 src/" - ], - "run-static-analysis-including-tests": [ - "@run-static-analysis", - "phpstan analyse --level=7 tests/" + "bin/phpstan analyse --configuration='./ci/phpstan/config.neon' --level=8 src/ tests/", + "bin/deptrac analyze './ci/deptrac/config.yml' --no-interaction --no-progress" ], "run-tests": [ - "phpunit" + "bin/phpunit --configuration='./ci/phpunit/config.xml'" ], "run-tests-with-clover": [ - "phpunit --coverage-clover build/logs/clover.xml" - ], - "validate-files": [ - "parallel-lint --exclude vendor --exclude bin ." + "bin/phpunit --configuration='./ci/phpunit/config.xml' --coverage-clover './build/logs/clover.xml'" ] }, diff --git a/src/MartinGeorgiev/SocialPostBundle/DependencyInjection/Compiler/AllInOnePass.php b/src/MartinGeorgiev/SocialPostBundle/DependencyInjection/Compiler/AllInOnePass.php index edd64a3..b77ef3e 100644 --- a/src/MartinGeorgiev/SocialPostBundle/DependencyInjection/Compiler/AllInOnePass.php +++ b/src/MartinGeorgiev/SocialPostBundle/DependencyInjection/Compiler/AllInOnePass.php @@ -13,8 +13,10 @@ /** * @since 1.0.0 + * * @license https://opensource.org/licenses/MIT - * @link https://github.com/martin-georgiev/social-post-bundle + * + * @see https://github.com/martin-georgiev/social-post-bundle */ class AllInOnePass implements CompilerPassInterface { @@ -25,10 +27,10 @@ public function process(ContainerBuilder $container): void foreach ($publishOn as $provider) { $serviceName = 'social_post.'.$provider; if (!$container->has($serviceName)) { - throw new OutOfBoundsException(sprintf('Cannot find service %s when injecting dependencies for "social_post"', $serviceName)); + throw new OutOfBoundsException(\sprintf('Cannot find service %s when injecting dependencies for "social_post"', $serviceName)); } if (!$container->get($serviceName) instanceof Publisher) { - throw new InvalidArgumentException(sprintf('Service %s should be an instance of %s', $serviceName, Publisher::class)); + throw new InvalidArgumentException(\sprintf('Service %s should be an instance of %s', $serviceName, Publisher::class)); } $definition->addArgument(new Reference($serviceName)); } diff --git a/src/MartinGeorgiev/SocialPostBundle/DependencyInjection/Configuration.php b/src/MartinGeorgiev/SocialPostBundle/DependencyInjection/Configuration.php index 4a5b4ee..239f955 100644 --- a/src/MartinGeorgiev/SocialPostBundle/DependencyInjection/Configuration.php +++ b/src/MartinGeorgiev/SocialPostBundle/DependencyInjection/Configuration.php @@ -10,15 +10,17 @@ /** * @since 1.0.0 + * * @license https://opensource.org/licenses/MIT - * @link https://github.com/martin-georgiev/social-post-bundle + * + * @see https://github.com/martin-georgiev/social-post-bundle */ class Configuration implements ConfigurationInterface { public function getConfigTreeBuilder(): TreeBuilder { $treeBuilder = new TreeBuilder('social_post'); - if (method_exists($treeBuilder, 'getRootNode')) { + if (\method_exists($treeBuilder, 'getRootNode')) { $rootNode = $treeBuilder->getRootNode(); } else { $rootNode = $treeBuilder->root('social_post'); diff --git a/src/MartinGeorgiev/SocialPostBundle/DependencyInjection/SocialPostExtension.php b/src/MartinGeorgiev/SocialPostBundle/DependencyInjection/SocialPostExtension.php index 71a89cb..5031b05 100644 --- a/src/MartinGeorgiev/SocialPostBundle/DependencyInjection/SocialPostExtension.php +++ b/src/MartinGeorgiev/SocialPostBundle/DependencyInjection/SocialPostExtension.php @@ -12,8 +12,10 @@ /** * @since 1.0.0 + * * @license https://opensource.org/licenses/MIT - * @link https://github.com/martin-georgiev/social-post-bundle + * + * @see https://github.com/martin-georgiev/social-post-bundle */ class SocialPostExtension extends Extension { @@ -54,7 +56,7 @@ private function setFacebookParameters(): void { $configuration = $this->configuration; - if (!in_array('facebook', $configuration['publish_on'], true)) { + if (!\in_array('facebook', $configuration['publish_on'], true)) { return; } @@ -76,7 +78,7 @@ private function setLinkedInParameters(): void { $configuration = $this->configuration; - if (!in_array('linkedin', $configuration['publish_on'], true)) { + if (!\in_array('linkedin', $configuration['publish_on'], true)) { return; } @@ -100,7 +102,7 @@ private function setTwitterParameters(): void { $configuration = $this->configuration; - if (!in_array('twitter', $configuration['publish_on'], true)) { + if (!\in_array('twitter', $configuration['publish_on'], true)) { return; } diff --git a/src/MartinGeorgiev/SocialPostBundle/SocialPostBundle.php b/src/MartinGeorgiev/SocialPostBundle/SocialPostBundle.php index d1f2490..545c441 100644 --- a/src/MartinGeorgiev/SocialPostBundle/SocialPostBundle.php +++ b/src/MartinGeorgiev/SocialPostBundle/SocialPostBundle.php @@ -10,8 +10,10 @@ /** * @since 1.0.0 + * * @license https://opensource.org/licenses/MIT - * @link https://github.com/martin-georgiev/social-post-bundle + * + * @see https://github.com/martin-georgiev/social-post-bundle */ class SocialPostBundle extends BaseBundle { diff --git a/tests/MartinGeorgiev/SocialPostBundle/DependecyInjection/SocialPostExtensionTest.php b/tests/MartinGeorgiev/SocialPostBundle/DependencyInjection/SocialPostExtensionTest.php similarity index 94% rename from tests/MartinGeorgiev/SocialPostBundle/DependecyInjection/SocialPostExtensionTest.php rename to tests/MartinGeorgiev/SocialPostBundle/DependencyInjection/SocialPostExtensionTest.php index 313aa8c..8a26716 100644 --- a/tests/MartinGeorgiev/SocialPostBundle/DependecyInjection/SocialPostExtensionTest.php +++ b/tests/MartinGeorgiev/SocialPostBundle/DependencyInjection/SocialPostExtensionTest.php @@ -12,14 +12,16 @@ /** * @since 1.0.0 - * @license https://opensource.org/licenses/MIT - * @link https://github.com/martin-georgiev/social-post-bundle + * + * @license https://opensource.org/licenses/MITs + * + * @see https://github.com/martin-georgiev/social-post-bundle */ class SocialPostExtensionTest extends TestCase { private function getConfigurationWithEmptyPublishOn(): array { - $yaml = <<assertSame( $expectedParameterValue, $containerBuilder->getParameter($containerParameter), - sprintf('%s parameter is correct', $containerParameter) + \sprintf('%s parameter is correct', $containerParameter) ); } /** * @test */ - public function will_throw_an_exception_when_no_value_for_publish_on() + public function will_throw_an_exception_when_no_value_for_publish_on(): void { $this->expectException(InvalidConfigurationException::class); $extension = new SocialPostExtension(); @@ -139,7 +141,7 @@ public function will_throw_an_exception_when_no_value_for_publish_on() /** * @test */ - public function will_throw_an_exception_when_no_facebook_provider_is_given() + public function will_throw_an_exception_when_no_facebook_provider_is_given(): void { $this->expectException(InvalidConfigurationException::class); $extension = new SocialPostExtension(); @@ -149,7 +151,7 @@ public function will_throw_an_exception_when_no_facebook_provider_is_given() /** * @test */ - public function will_throw_an_exception_when_no_linkedin_provider_is_given() + public function will_throw_an_exception_when_no_linkedin_provider_is_given(): void { $this->expectException(InvalidConfigurationException::class); $extension = new SocialPostExtension(); @@ -159,7 +161,7 @@ public function will_throw_an_exception_when_no_linkedin_provider_is_given() /** * @test */ - public function will_throw_an_exception_when_no_twitter_provider_is_given() + public function will_throw_an_exception_when_no_twitter_provider_is_given(): void { $this->expectException(InvalidConfigurationException::class); $extension = new SocialPostExtension(); @@ -169,7 +171,7 @@ public function will_throw_an_exception_when_no_twitter_provider_is_given() /** * @test */ - public function facebook_defaults_with_minimal_configuration() + public function facebook_defaults_with_minimal_configuration(): void { $configs = $this->getMinimalConfiguration(); $containerBuilder = new ContainerBuilder(); @@ -194,7 +196,7 @@ public function facebook_defaults_with_minimal_configuration() /** * @test */ - public function complete_configuration() + public function complete_configuration(): void { $configs = $this->getCompleteConfiguration(); $containerBuilder = new ContainerBuilder(); diff --git a/tests/MartinGeorgiev/SocialPostBundle/SocialPostBundleTest.php b/tests/MartinGeorgiev/SocialPostBundle/SocialPostBundleTest.php index f7b1392..f2b028e 100644 --- a/tests/MartinGeorgiev/SocialPostBundle/SocialPostBundleTest.php +++ b/tests/MartinGeorgiev/SocialPostBundle/SocialPostBundleTest.php @@ -11,15 +11,17 @@ /** * @since 1.0.0 + * * @license https://opensource.org/licenses/MIT - * @link https://github.com/martin-georgiev/social-post-bundle + * + * @see https://github.com/martin-georgiev/social-post-bundle */ class SocialPostBundleTest extends TestCase { /** * @test */ - public function will_add_compiler_class_for_the_main_AllInOne_service() + public function will_add_compiler_class_for_the_main_all_in_one_service(): void { $compilerPass = new AllInOnePass(); $containerBuilder = $this->createMock(ContainerBuilder::class); From 8e6d5e5c0d0ebc2a1082afd402bc1e37f291d3dc Mon Sep 17 00:00:00 2001 From: Martin Georgiev Date: Sat, 30 May 2020 14:21:10 +0100 Subject: [PATCH 2/2] no message --- .../DependencyInjection/Configuration.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/MartinGeorgiev/SocialPostBundle/DependencyInjection/Configuration.php b/src/MartinGeorgiev/SocialPostBundle/DependencyInjection/Configuration.php index 239f955..4cfd8bd 100644 --- a/src/MartinGeorgiev/SocialPostBundle/DependencyInjection/Configuration.php +++ b/src/MartinGeorgiev/SocialPostBundle/DependencyInjection/Configuration.php @@ -19,11 +19,12 @@ class Configuration implements ConfigurationInterface { public function getConfigTreeBuilder(): TreeBuilder { - $treeBuilder = new TreeBuilder('social_post'); - if (\method_exists($treeBuilder, 'getRootNode')) { - $rootNode = $treeBuilder->getRootNode(); - } else { + if ($this->isBeforeSymfony4()) { + $treeBuilder = new TreeBuilder(); $rootNode = $treeBuilder->root('social_post'); + } else { + $treeBuilder = new TreeBuilder('social_post'); + $rootNode = $treeBuilder->getRootNode(); } $rootNode @@ -44,6 +45,11 @@ public function getConfigTreeBuilder(): TreeBuilder return $treeBuilder; } + private function isBeforeSymfony4(): bool + { + return !\method_exists(TreeBuilder::class, 'getRootNode'); + } + private function addFacebook(ArrayNodeDefinition $node): void { $node