From 87391036f80fb0b0c6aa7c29761ce6c041329208 Mon Sep 17 00:00:00 2001 From: Florent Torregrosa Date: Fri, 28 Jun 2024 13:01:15 +0200 Subject: [PATCH] fix(YAML): Enable YAML custom tags support (#3456991 by Grimreaper) --- coder_sniffer/DrupalPractice/Project.php | 2 +- tests/DrupalPractice/Objects/testmodule.services.yml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/coder_sniffer/DrupalPractice/Project.php b/coder_sniffer/DrupalPractice/Project.php index a2f3db5b..c7d6a6a5 100644 --- a/coder_sniffer/DrupalPractice/Project.php +++ b/coder_sniffer/DrupalPractice/Project.php @@ -190,7 +190,7 @@ public static function isServiceClass(File $phpcsFile, $classPtr) return false; } - $services = Yaml::parse(file_get_contents($ymlFile)); + $services = Yaml::parse(file_get_contents($ymlFile), Yaml::PARSE_CUSTOM_TAGS); if (isset($services['services']) === false) { $cache[$phpcsFile->getFilename()] = false; return false; diff --git a/tests/DrupalPractice/Objects/testmodule.services.yml b/tests/DrupalPractice/Objects/testmodule.services.yml index 98f3a51e..b680731f 100644 --- a/tests/DrupalPractice/Objects/testmodule.services.yml +++ b/tests/DrupalPractice/Objects/testmodule.services.yml @@ -1,3 +1,8 @@ services: testmodule.example: class: Drupal\testmodule\ExampleService + + testmodule.test_tagged_iterator: + class: Drupal\testmodule\ExampleService + arguments: + - !tagged_iterator coder_test